Digging as to escape? or digging to have a cool place to lay down in? Some dogs are just diggers. When we first got our Great Pyr from a rescue shelter (in Texas), we called him the Gardening Assistant.... Then we realized he was really looking for a way to keep cool. So we hollowed out a small space in a shady area of our yard. We would hose down the area during summer and he really loved it. As far as the shock collar goes, we never had much luck with them in the past. I guess that depends on the dog too. We used to have a dog that we thought would misbehave just to get the shock..
Fill up water ballons with half vinegar/ half water and put it in the holes they have made, and cover back up with dirt when dogs arent looking. Most dogs will dig in the same place again. *Dig Dig Dig Dig Dig POP* Very unpleasant. It will take several "rounds" of popping vinegar ballons for them to associate digging with the unpleasant expeirence.
That crazy squeaky lady in the spandex on animal planet says you should make room for them to dig holes, whether it be a sandbox or what-have-you. Some dogs were bred for that sort of thing. Just fence off a section and bury some toys for them. Then they should just dig in that area. Good luck.
A garden spray bottle filled with water and vinager works too. Ours digs when her pool water gets too warm for her taste.
If you'r a male, or have a male in the family, pee in the holes. Serously, it works! Its a territorial thing...
I just fill in the holes and forget it. Usually they are after a mole or something only they can hear, at least with my dogs. I have read that putting pepper in the area they are digging causes them to sneeze so much they quit. Never tried it. My yard looks like small landmines went off all over, if it isn't the dogs, it is the cats or the rooster... who made HUGE holes. I try not to trip in them before I can fill them.