كتاب المساقاة
22  
The Book of Musaqah
(10)
Chapter: The command to kill dogs, and its abrogation. The prohibition of keeping dogs, except for hunting, farming, (herding) livestock and the like
(10)
بَاب الْأَمْرِ بِقَتْلِ الْكِلَابِ وَبَيَانِ نَسْخِهِ وَبَيَانِ تَحْرِيمِ اقْتِنَائِهَا إِلَّا لِصَيْدٍ أَوْ زَرْعٍ أَوْ مَاشِيَةٍ وَنَحْوِ ذَلِكَ
Sahih Muslim 1570 c

Abdullah (b. Umar) (Allah be pleased with them) reported:

Allah's Messenger (ﷺ) ordered the killing of dogs and we would send (men) in Medina and its corners and we did not spare any dog that we did not kill, so much so that we killed the dog that accompanied the wet she-camel belonging to the people of the desert.
وَحَدَّثَنِي حُمَيْدُ بْنُ مَسْعَدَةَ، حَدَّثَنَا بِشْرٌ، - يَعْنِي ابْنَ الْمُفَضَّلِ - حَدَّثَنَا إِسْمَاعِيلُ، - وَهُوَ ابْنُ أُمَيَّةَ - عَنْ نَافِعٍ، عَنْ عَبْدِ اللَّهِ، قَالَ كَانَ رَسُولُ اللَّهِ صلى الله عليه وسلم يَأْمُرُ بِقَتْلِ الْكِلاَبِ فَنَنْبَعِثُ فِي الْمَدِينَةِ وَأَطْرَافِهَا فَلاَ نَدَعُ كَلْبًا إِلاَّ قَتَلْنَاهُ حَتَّى إِنَّا لَنَقْتُلُ كَلْبَ الْمُرَيَّةِ مِنْ أَهْلِ الْبَادِيَةِ يَتْبَعُهَا ‏.‏
Reference : Sahih Muslim 1570c
In-book reference : Book 22, Hadith 57
USC-MSA web (English) reference : Book 10, Hadith 3811
  (deprecated numbering scheme)