This is a common problem that dog trainers get called for all the time. If you step back a bit, you’ll realize that dogs bark for many reasons.
There is excited play-alert barking where the dog is having fun and enjoying whatever activity he is engaged in.
Fearful alarm barking is when a dog is scared or stressed at something he has never seen before or is simply under-socialized or shy.
Demand barking is usually from a dog that is being pushy.
Then there is the common problem of territorial barking where this occurs mainly at home.
Also, dogs can bark if there’re bored.
I have also mentioned in previous posts about choosing your dog breed carefully. Some dogs have barking in their genetic make up and stopping it in these incidences can be very difficult.
When you’re dealing with barking, it is important to identify the cause of the barking before trying to stop it. For example, if your dog barks every time you put him out in the backyard, you might find that he is bored especially if he is left out there for long periods of time. I have always advocated having an indoor dog. Dogs have been bred to be with us and work for us and not be left alone for long periods of time. Another example would be if you have a dog that is engaging you in direct eye contact or growls or barks at you when you want him off the couch. He could be engaging in demand or dominance barking. A good trainer would put you on a program of relationship/leadership exercises where he/she can put the owner on a routine of controlling resources and submissive body-posturing exercises.
With good leadership, some knowledge and thoughtful guidance from a dog trainer, many a barking problem can be abated or even eliminated