Dogs bark for a variety of reasons and it's important to understand the reason for barking in order to fix the the problem. Remember to treat the problem and not the symptom, otherwise the barking will persist.
Reasons dogs bark:
1. Alert barking: lets your dog tell you there is something out of the ordinary
2. Defensive barking: dogs do this when they are afraid and to scare that thing causing the fear away from them
3. Attention barking: your dog wants your attention
4. Frustration barking: occurs when your dog is confused, frustrated or stressed
5. Boredom barking: done out of boredom when your dog wants to amuse himself or herself
How to determine which kind of barking your dog is doing:
Remember to look at the whole situation and to listen to your dog. Consider the circumstances that led up to your dog's barking and determine if that was an appropriate response. If a car pulls into your driveway, your dog barking out of defense is a reasonable reaction to the situation.
You can lessen the barking over time by immediately addressing your dog and thanking him for barking to alert you. Once you have acknowledged your dog, they will learn they only have to bark shortly to get your attention.
Another common strategy to help curb barking is to reward your dog for the absence of barking. If they opt to not bark in a situation that would typically trigger barking, make a big deal of it. Praise them and reward them with a treat.