All dogs make some form of noise, whether it's barking, whining, or - in the case of some breeds - screaming and yowling. They might be trying to tell you something, trying to initiate play, trying to scare off a potential intruder, alerting you to the presence of - well, just about anything. It's all part of owning a dog.
Having said that, though, there's reasonable barking and then there's just unnecessary barking. If your dog is barking too much, you'll need to take steps to both find out WHY, and to treat the cause.
Toys and Exercise
One of the main causes of excessive barking is frustration and pent-up energy. Remember, dogs are active creatures who NEED at least one long walk of at least one hour every day. Ideally, your dog should be walked three times a day, of which two walks should be long. If they don't get this basic requirement, they become anxious, moody, hyperactive, and frustrated - which they'll express through barking.
"Anti-bark" collars are available, which spray a fine mist of citronella spray into your dog's face whenever it barks. This is an effective way of stopping your dog barking: citronella is HIGHLY offensive to dogs, and being sprayed at such a close range is hard on their delicate, super-alert noses.
It's worth considering this from your dog's point of view, howeveer. Stopping a dog from barking without finding out why he was barking in the first place isn't a particularly humane way of exercising control over your dog. There WILL be a reason; more often than not, excessive barking is signalling intense frustration and excess energy.
Changing the environment
If your dog can see through the fence - for example, if it's chain-link or slatted wood - then he can see everyone that walks past. This will generally trigger territorial instincts (particularly if dogs walk by) like loud, repetitive barking.
Whenever someone passes by,it reinforces your dog's impression that he's doing a job: in this case, scaring off potential intruders. Someone walks along, the barks, the person soon vanishes from sight - the dog thinks, "I just scared that person off" and continues barking at everyone who comes along.
Ideally, your yard should be highly fenced with a material that your dog can't see through. This can have a dramatically quietening effect upon the most confirmed barkers.
Provide a Distraction
Before you do anything for your dog, he has to do something for you first. Sometimes, dogs test the boundaries by attempting to make YOU do things for THEM. Barking to 'get things' - attention, pats, a toy, a meal - isn't acceptable behavior: he's trying to dominate you. You dole out affection on YOUR terms, not his. As soon as he's quiet again, though, feel free to show him as much attention as you like, especially if you get him to do something for you first: for example, before he gets fed, he has to sit on command.
You can also try aversion tactic: every time your dog barks repetitively, you can spray him with water from a water-pistol, or shake a can filled with pebbles.
Make sure he's not aware that you're the cause of the noise. If he knows it's you, it will begin to erode the trust between the two of you; and, he will probably still bark whenever you're not around.
Timing is very important when using this technique; you have to spray him/shake the can AS SOON AS he starts to bark. If you're even a little bit off, he'll get confused and the message won't get through .
A lot of people see barking as something to be gotten rid of, not a symptom of something else. It's important that you realize that, by barking, your dog is attempting to communicate something important to you; don't just regard it as a nuisance to be silenced at all costs.