كتاب المساقاة
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 1574 a

Ibn Umar (Allah be pleased with him) reported Allah's Messenger (ﷺ) as saying:

He who keeps a dog other than that meant for watching the herd or for hunting loses every day out of his deeds equal to two qirat.
حَدَّثَنَا يَحْيَى بْنُ يَحْيَى، قَالَ قَرَأْتُ عَلَى مَالِكٍ عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ مَنِ اقْتَنَى كَلْبًا إِلاَّ كَلْبَ مَاشِيَةٍ أَوْ ضَارِي نَقَصَ مِنْ عَمَلِهِ كُلَّ يَوْمٍ قِيرَاطَانِ ‏"‏ ‏.‏
Reference : Sahih Muslim 1574a
In-book reference : Book 22, Hadith 62
USC-MSA web (English) reference : Book 10, Hadith 3815
  (deprecated numbering scheme)