houndlove touched on an important point -- this sort of training has to be constant ... and it's about way way way way MORE than barking. If you try to train JUST 'no barking' you're gonna fail because it's all part of the whole relationship package you have with your dog. If your dog knows you're gonna 'ignore bad behavior' and just leave him to bark his brains out for X minutes -- he's gonna do it and THEN come in when he wants to. (and if you THEN reward him for 'not barking' it's like someone said above you are rewarding him FOR barking all he wanted to!)
My dogs know from day 1 in my house (and lots of older fosters have learned this to live here and I never EVER do puppies so every dog who walks into my house learns this as an adult!!) -- you don't bark in the house. Period. End of statement. You can bark once to 'tell' me something and that's GREAT and I'm gonna tell you thanks for telling ME.
But as others have mentioned above it has a whole lot to do with WHY he's barking (and I love the comment above about if a dog is outside barking because he's bored he needs his life-style evaluated rather than training RAH!!!!!! DEAD ON RIGHT!).
Dogs will bark when bored. They'll bark to communicate with others out there who aren't part of their pack. But most of the time they bark either to 'tell' the pack something OR to protect the pack/warn outsiders to get the heck outa Dodge.
Right this VERY instant, Luna is having her own little nervous hissy fit because I've got a couple of guys about 3' from my front door laying a new cement sidewalk. They have the AUDACITY to be talking, walkin on HER yard, banging on boards, and generally doing STUFF to **HER** yard. She has been back and forth, to and fro, and making "worried noises" (yep, hound mix!!) but she has barked ONCE.
But -- I'm stopping to talk to her ... "You know Mom was JUST outside and talking with them and it's Jerome and 'nother friend of his doing work FOR Mom ... so it's OK. They stay!"
Does she understand all those words? Heckfire no. BUT she understands my tone. She knows I"m 'splainin' to her and I'm telling her I'm in control and I'm the alpha bitch of this household and what *I* say goes. (and no, this isn't a discussion on leadership -- but I'm 52 years old, fought for this house in a divorce and it's MY house!! dang it! *grin*)
But it's a process. She doesn't LIKE what's going on ... but she knows I AM on top of it ... she doesn't have to. But I acknowledge that she hears what I don't. She smells what I don't. And that's fine.
I make myself available for her to 'tell' me (much like what houndlove said above -- that's exactly what I do -- I let her come tell ME).
espenser said above to put yourself between the dog and the 'thing' -- that's exactly it. You don't have to 'punish' to get their attention. But you DO have to be consistent. You can't yell a couple of times and give up.
Many many times we're ultimately too lazy to get their attention. We want to call them from 40' away and then complain that they won't 'come' to us.
If you call your dog from X feet away and the dog ignores you -- if you call them 3-4 more times ... you've taught them to count. Either to count how many times you'll yell before you give up ... or before you get mad (not you personally -- I'm generalizing here). But if you call the dog ONE TIME ... and it disses you ... GO THERE. In fact, sometimes I will go there, put myself in FRONT of the dog, and STAND THERE -- bent over a bit, a scowl or dissatisfied look on my face, feet slightly apart, body rigid and I will say something brilliantly sarcastic like "Excuuuuuuuuuse ME???????????????"
It's the tone -- gulp -- Mom's not happy. That's not punishment -- it's communication. Aha, but I have your attention now we can do something here. "Sit" -- GOOD BOY. Now I've rocked the attention back to ME. (where it oughta be when I opened my mouth the first time -- he knows that, I don't have to belabor the point)
If he continues to ignore my physical presence and voice -- I would reach down and touch him. (if he hasn't already 'run away' from me). Not a hit -- simply to reach under his chin and tip his head up to LOOK AT ME.
I would then say "No barking shhhhh" and I would reinforce that by simply shutting his muzzle between my thumb and forefinger while I snap on his lead. You're coming in now (I don't even need to say that -- he KNOWS he's busted). Ant at MY house if you fail to come when called you wind up on leash for a while!!
I talk -- I talk endlessly -- because my voice is the best tool of praise I have. My voice can soothe. My voice can communicate. My voice conveys confidence. But the words are familiar. And they ultimately become commands.
I expect a whole lot from my dogs -- and yes, some dogs vocalize more than others (Luna's a hound mix and 'talking' is what she does best **sheesh**) -- but you can train them to control it to a great degree IF you give them a set of behaviors to do to accomplish what they WANT to do when they vocalize. If they're worrying over a squirrel or animal -- they come tell ME and we go 'find' it and I make my own judgment (which unbeknownst to them is always gonna be "leave it!") -- but I can reward them for TELLING me. I can reward them for bringing the problem to me to solve.
When I say a dog's name I want that to be the sweetest sound on earth to him. I don't want it to mean 'no' or "I am mad!"
There are as many ways of attacking this situation as there are people with dogs -- and some of us are more comfortable talking to our dogs than others. It's simply MY way. But if you're looking for a consensus of opinions and logic, that's why threads like this are great.
(and btw ... the guys are done with the concrete forms and Luna's only worry now is whether she can convince ME it's time to eat ... but she also knows at this point pointed looks at the kitchen are her most effective tool -- but she was really glad when I got the guys to 'go away' (they were done but she doesn't know that). But she DOES know supper was late because of it and for Luna -- THAT is the crime of the century!!!)