Three methods to help prevent your dog from digging
A bored dog will likely dig for stimulation purposes. As an instinctive behavior your dog may turn to digging holes as a way of occupying its time. The bored dog is much more likely to engage in this act than a dog which is much more focused on you and other activities it has at its disposal.
As previously mentioned, make sure that your dog has plenty to occupy its mind. Make sure you spend time with it stimulating the mind through games and training. A rigorous exercise regime whereby you take your dog out to new places will also ensure that it has lots of new experiences and therefore prevent it from becoming a victim of a normal, routine, boring way of life.
A dog which is left to its own devices all day in the yard with nothing else to do will more than likely end up digging as an answer to its boredom. Certaining there are other reasons why a dog digs and some problem dogs will dig through other behavioral issues rather than those mentioned above.
In these cases the dog will not cease digging just be employing the above methods. Professional advice should be sought in these instances to isolate and therefore rid the specific behavior responsible.