The command to kill dogs, and its abrogation. The prohibition of keeping dogs, except for hunting, farming, (herding) livestock and the like Sahih Muslim 1573 a
Arabic hadith text
حَدَّثَنَا عُبَيْدُ اللَّهِ بْنُ مُعَاذٍ، حَدَّثَنَا أَبِي، حَدَّثَنَا شُعْبَةُ، عَنْ أَبِي التَّيَّاحِ، سَمِعَ مُطَرِّفَ، بْنَ عَبْدِ اللَّهِ عَنِ ابْنِ الْمُغَفَّلِ، قَالَأَمَرَ رَسُولُ اللَّهِ صلى الله عليه وسلم بِقَتْلِ الْكِلاَبِ ثُمَّ قَالَ " مَا بَالُهُمْ وَبَالُ الْكِلاَبِ " . ثُمَّ رَخَّصَ فِي كَلْبِ الصَّيْدِ وَكَلْبِ الْغَنَمِ .
Translation
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.