The Messenger of Allah ﷺ said, "Whoever keeps a dog, other than a hunting dog or a livestock dog, two qirats are deducted from his reward each day."
أخبرنا قتيبة قال حدثنا الليث عن نافع
إن رسول الله ﷺ قال من أمسك كلبا إلا كلبا ضاريا أو كلب ماشية نقص من أجره كل يوم قيراطان
Bukhari narrated it in the chapters on Slaughtered Animals and Hunting, in the section "One who keeps a dog that is not a hunting dog or a herding dog," hadith no. 5482, and Muslim narrated it, hadith no. 1574, in the chapter on Sharecropping, the previous section, from the hadith of Malik, from Nafi, with the same wording. It is also found in Sunan al-Kubra, hadith no. 4797.