The command to kill dogs, and its abrogation. The prohibition of keeping dogs, except for hunting, farming, (herding) livestock and the like Sahih Muslim 1575 a

Arabic hadith text
وَحَدَّثَنِي أَبُو الطَّاهِرِ، وَحَرْمَلَةُ، قَالاَ أَخْبَرَنَا ابْنُ وَهْبٍ، أَخْبَرَنِي يُونُسُ، عَنِ ابْنِ، شِهَابٍ عَنْ سَعِيدِ بْنِ الْمُسَيَّبِ، عَنْ أَبِي هُرَيْرَةَ، عَنْ رَسُولِ اللَّهِ صلى الله عليه وسلم قَالَ ‏"‏مَنِ اقْتَنَى كَلْبًا لَيْسَ بِكَلْبِ صَيْدٍ وَلاَ مَاشِيَةٍ وَلاَ أَرْضٍ فَإِنَّهُ يَنْقُصُ مِنْ أَجْرِهِ قِيرَاطَانِ كُلَّ يَوْمٍ ‏"‏ ‏.‏ وَلَيْسَ فِي حَدِيثِ أَبِي الطَّاهِرِ ‏"‏ وَلاَ أَرْضٍ
Translation
Abu Huraira reported Allah's Messenger (ﷺ) as saying

He who kept a dog which is neither meant for hunting nor for watching the anitmals nor for watching the fields would lose two qirat every day out of his reward; and there is no mention of the fields in the hadith transmitted by Abu Tahir.