What your dog tries to tell you by vocalizing
Some people tend to speak more, faster, and louder when stressed. The same is true for dogs. They learn to exhibit behavior that makes them feel more in control of the stressful situation. Preventing them from exhibiting this behavior doesn't really calm them down, and punishing them for it will only exacerbate the problem by making them anxious and fearful. To deal with your dog's excessive barking, you must first deal with the emotions that lead him to vocalize so fervently. If you are not afraid or anxious, you will not 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, will not tend to bark when a visitor arrives. Instead, you can sit quietly in front of the fridge, having associated the sound of the doorbell with the food, triggering a positive emotion and therefore silence.
To get your dog to do this, ask a friend to walk your porch without ringing the doorbell or entering. When the dog barks, he throws out a handful of his favorite treats. If the exercise is done correctly, the dog will bark, eat, bark, eat, etc. Your friend should stay outside without moving while throwing treats on the floor. Eventually, the barking will subside and the dog will eat more and more, until his friend can get in without the dog barking.