It is narrated from Hazrat Ibn Mughaffal that the Prophet (peace be upon him) initially ordered the killing of dogs, but later said that there is no longer a need for this, and permitted keeping dogs for hunting and for guarding herds of goats. And he said that when a dog puts its mouth in a vessel, wash it seven times and scrub it with earth the eighth time.
Hadith Referenceمسند احمد / أول مسند البصريين / 20566