water smells like sewer water

This is the second time I tried to post this, so forgive me if this is a repeat. I am a new blogger for this forum:

I recently ran a 150' clean water line to my barn in the back yard from our home. The line provides clean water and adequate pressure. The line runs into the barn, and fork
s
out to a 30 gallon hot water heater, and also forks on the cold water side to a washer downstairs, then upstairs to a toilet and sink. The hot water side only goes to the sink
and washer.

All drain lines are properly vented, and no leaks have been found. The water in the house is fine, no problems with the odor.

What is happening is that the hot and cold water output in both the sink and washer smells like sewer water. I don't know where it could be coming from, unless it is because
the cold water feed to the toilet is directly above the washer connection. The hot water smells worse than the cold water, but we can notice the smell from both. The water
is clear in color, so no known contamination.

Is it possible that I need a backflow preventer on the cold water line to the toilet, and would this resolve this problem?

Well, perhaps I found the problem. I took a chance and bought a backflow preventer/check valve, and placed it on the pipe leading up to the toilet. As soon as I cut into the pipe, I received a big whiff of sewer water from the excess coming down from the toilet. Hopefully the valve I placed in here will solve this problem. Here's hoping.

There should be no connection to the sewer from the toilet's supply line. Something else is going on here and you should fix it. Look at the toilet tank and the hose from the fill valve that goes to the overflow. Make sure that hose isn't stuck down inside the overflow. It should have a clip holding it up above the rim of the overflow. Many toilet fill valves have built-in anti-siphon valves, and an external check valve should neither be needed or required.

It's physically impossible for dirty toilet water (i.e. from the bowl) to contaminate the water supply. It seems like
the pipe you used for the water supply has some weird odor, and is transferring its odor to the water. What kind
of pipe is it? Newly installed copper water tube will impart a funky smell to the water until it's been flushed out
for a while.

This is a bizarre and dangerous situation.
The fact that your hot water line smells bad suggests to me that the problem isn't confined to some sort of cross connection at the toilet - how would waste water going into the cold water supply at the toilet get into the water heater?

Seems like the OP needs a plumber. People are going to get very sick if this isn't corrected.

Anybody think maybe the anode rod in the water heater is causing the smell. And it's pushing water back out of the inlet as it heats up. Flush the heater out and/ or replace the anode with an aluminum one.

Many toilet fill valves have antisiphon functionality built in that should prevent any backflow from the toilet. But, unless the insides of the toilet tank are gross, it still wouldn't normally create any smells as described in the rest of the potable water system. It would take some bizarre conditions to put toilet water back into the potable supply.

I'm a new construction builder and not a plumber. Sadly I had resent experence with houses sitting unsold. Over time the water will sour especially in the hot water system ( tank ? ) and I've had to run 100's of gallons through these homes before it clears. You tell me, I don't know but I've had it happen on more than one "new" house.

Kenwalkerconst's idea was what actually fixed the problem. The backflow preventer only prevented the smell for about a week. What really cured the problem was the installation of a shower in the bathroom area. This caused more water to flow through the area, and since this was done, no more stink! Thank you for all the comments and suggestions!