Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
muslim:1573b[Chain 1] Khālid / Ibn al-Ḥārith [Chain 2] Muḥammad b. Ḥātim > Yaḥyá b. Saʿīd [Chain 3] Muḥammad b. al-Walīd > Muḥammad b. Jaʿfar [Chain 4] Isḥāq b. Ibrāhīm > al-Naḍr [Chain 5] Muḥammad b. al-Muthanná > Wahbb. Jarīr > Shuʿbah Bihadhā al-Isnād

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.  

مسلم:١٥٧٣bوَحَدَّثَنِيهِ يَحْيَى بْنُ حَبِيبٍ حَدَّثَنَا خَالِدٌ يَعْنِي ابْنَ الْحَارِثِ ح وَحَدَّثَنِي مُحَمَّدُ بْنُ حَاتِمٍ حَدَّثَنَا يَحْيَى بْنُ سَعِيدٍ ح وَحَدَّثَنِي مُحَمَّدُ بْنُ الْوَلِيدِ حَدَّثَنَا مُحَمَّدُ بْنُ جَعْفَرٍ ح وَحَدَّثَنَا إِسْحَاقُ بْنُ إِبْرَاهِيمَ أَخْبَرَنَا النَّضْرُ ح وَحَدَّثَنَا مُحَمَّدُ بْنُ الْمُثَنَّى حَدَّثَنَا وَهْبُ بْنُ جَرِيرٍ كُلُّهُمْ عَنْ شُعْبَةَ بِهَذَا الإِسْنَادِ وَقَالَ ابْنُ حَاتِمٍ فِي حَدِيثِهِ

عَنْ يَحْيَى وَرَخَّصَ فِي كَلْبِ الْغَنَمِ وَالصَّيْدِ وَالزَّرْعِ