Question
What is the best way to stop my fenced-in dog from barking at people who are passing by on the street?
Answer
This is a very tricky problem for the simple fact that your dog gets rewarded every time it barks at a passerby. In the dog's head, it's all very simple.
Person approaches, dog barks, person leaves.
Yay to the power of barking!
Depending on the size of your garden, if none of TildalWave's suggestions are an option, you might have to temporarily keep your dog in the house while you're not at home and in a room that doesn't allow him to bark at passersby through the window.
The long-term approach is to use desensitisation and counter-conditioning, that is, slowly get your dog used to strangers coming near the fence and start to associate strangers with good things happening(TM).
You'll have to recruit some strangers (to your dog) and ask them to approach the fence to a distance that your dog is comfortable with. Reward your dog for noticing the stranger but not barking at it. Slowly move the dog and/or stranger closer together and keep rewarding good behaviour. Try to set your dog up for success as much as possible. The less often you get your dog's threshold wrong, the quicker it'll learn.
Also, it is very important for the stranger not to move away if your dog does start barking, as this will only reinforce the unwanted behaviour. Just ask the person to stay still and move your dog further away from the fence. Most of all, exercise plenty of patience as it might take a while.
Answered By - ThomasH