I had a dog with a similar habit, and it turned out that he had an allergy to fleas. Therefore, it may be that your dog is allergic to something. I never did get my dog to stop completely. You should take him to your vet and find out if he has allergies. Outside of that, use a cone.