The Messenger of Allah ﷺ said, "Whoever keeps a dog, other than a dog for guarding livestock or a dog for hunting, two qirats are deducted from his good deeds each day." He used to order that dogs be killed.
حدثنا محمد بن عبيد حدثنا عبيد الله عن نافع
أن رسول الله ﷺ قال من اقتنى كلبا إلا كلب ماشية أو كلب صيد نقص من عمله كل يوم قيراطان وكان يأمر بالكلاب أن تقتل
Its isnad is sahih, and it is a longer version of 5505. The order to kill dogs has already appeared in the narration of Ismail bin Umaya from Nafi, 4744, where we noted the narration of the two Shaykhs [Bukhari and Muslim]. Muslim also narrated it, 1:461, through the narration of Ubaydullah from Nafi.