(10) بَاب الْأَمْرِ بِقَتْلِ الْكِلَابِ وَبَيَانِ نَسْخِهِ وَبَيَانِ تَحْرِيمِ اقْتِنَائِهَا إِلَّا لِصَيْدٍ أَوْ زَرْعٍ أَوْ مَاشِيَةٍ وَنَحْوِ ذَلِكَ
In the hadith transmitted on the authority of Yahya, he (the Holy Prophet) permitted the keeping of dogs for (the protection of) herds, for hunting and (the protection of) cultivated land.
Reference: Sahih Muslim 1573 b
In-book reference: Book 22, Hadith 61
USC-MSA web (English) reference(deprecated numbering scheme): Book 10, Hadith 3814
Read hadith from the major collections in the app, with prayer times and a Qibla compass. Free.