What your vocal dog is trying to tell you
Some people tend to talk more, faster and in a higher pitch when they get stressed. The same thing happens with dogs. They learn to exhibit a behaviour that makes them feel more in control of the stressful situation. Preventing them from exhibiting this behaviour doesn’t really calm them down, and punishing them for it will only exacerbate the problem by making them both anxious and fearful. To deal with your dog’s excessive barking, you must first deal with the emotions that are leading him to vocalize with such fervour. If he’s not afraid or anxious, he won’t bark.
The unknown triggers barking because it creates the stress of uncertainty and the unexpected.
A well socialized dog that associates visitors with food, for example, won’t tend to bark when a visitor arrives. Instead, he may sit calmly in front of the fridge, having associated the sound of the doorbell with food, which triggers a positive emotion and, thus, silence.
To get your dog to do this, ask a friend to come by your porch without ringing the bell or coming inside. When the dog barks, throw a handful of his favourite treats at him. If the exercise is done correctly, the dog will bark, eat, bark, eat, etc. Your friend must stay outside without moving as you throw treats on the floor. Eventually, the barking will lessen, and the dog will eat more and more, until your friend can enter without the dog barking.