Many dogs have behaviors their owners do not understand. Some of these behaviors become habitual and can be quite dangerous for your dog if they continue. If your dog has created a habit which can cause internal problems for him, you may want to have him checked out by your veterinarian for potential reasons for the behavior.
Behavior by dogs eating materials which are not digestible is called a pica disorder. There is a difference between eating something indigestible such as rocks and chewing on an inedible object such as a chew toy to relieve teething pain, cure boredom, or for play. Dogs learn from an early age eating feels good, and because they use their mouths to explore their senses, as puppies, they tend to put everything in their mouths. Eating indigestible items such as rocks can become a problem. If your dog did not learn as a puppy not to eat rocks, he might need to be taught now to avoid gastrointestinal problems.
While catching your dog eating rocks, you can use 'drop it' or other commands to get him to not only release the rocks from his mouth but also create the habit of not eating rocks. The 'drop it' command can be an important command to teach your dog if he tends to get into things he should not. 'Drop it' works for rocks, children's toys, your socks, and shoes, or any other item your dog has in his mouth. Once your dog knows how to stop the bad habit of eating rocks, you can teach him to 'leave it'.
Other ways to teach your dog to stop eating rocks will include offering alternatives to rocks and changing behavior. Creating new habits for dogs, much like creating patterns for humans, takes time, repetition, and praise. Depending on how motivated your dog is to give up the act of eating rocks, he could stop this behavior in a couple of weeks, or it could take up to a couple of months. Be persistent, and understand your dog could have some health problems down the road if he continues eating rocks.
You will need a few things to start retraining your dog. If you have trained other commands with him using a clicker, have your clicker handy. You will also need treats and alternative chew toys for your dog. You will also want some of your dog's favorite chew toys. Time and patience will be required of you, along with dedication, repeating these new ideas with your dog several times a day.