The Book of Musaqah
22/10. Chapter:
The command to kill dogs, and its abrogation. The prohibition of keeping dogs, except for hunting, farming, (herding) livestock and the like
Sahih Muslim
حَدَّثَنَا عُبَيْدُ اللَّهِ بْنُ مُعَاذٍ، حَدَّثَنَا أَبِي، حَدَّثَنَا شُعْبَةُ، عَنْ أَبِي التَّيَّاحِ، سَمِعَ مُطَرِّفَ، بْنَ عَبْدِ اللَّهِ عَنِ ابْنِ الْمُغَفَّلِ، قَالَ أَمَرَ رَسُولُ اللَّهِ صلى الله عليه وسلم بِقَتْلِ الْكِلاَبِ ثُمَّ قَالَ " مَا بَالُهُمْ وَبَالُ الْكِلاَبِ " . ثُمَّ رَخَّصَ فِي كَلْبِ الصَّيْدِ وَكَلْبِ الْغَنَمِ .
Ibn Mughaffal reported: Allah's Messenger (ﷺ) ordered the killing of dogs and then said: what is the trouble with them (the people of Medina)? How dogs are nuisance to them (the citizens of Medina)? He then permitted keehing of dogs for hunting and (the protection of) herds.
Reference : Sahih Muslim 1573aIn-book reference : Book 22, Hadith 60USC-MSA web (English) reference : Book 10, Hadith 3814