The Messenger of Allah ﷺ ordered that dogs be killed, except for a hunting dog or a dog used for guarding livestock.
أخبرنا قتيبة قال حدثنا حماد عن عمرو
أن رسول الله ﷺ أمر بقتل الكلاب إلا كلب صيد أو كلب ماشية
Muslim narrated it in "The Book of Sharecropping," in the chapter on the command to kill dogs and the explanation of its abrogation, etc., hadith no. 1571, from the hadith of Hammad bin Zayd, with this wording. It is also in Al-Kubra, hadith no. 4790.Amr is Ibn Dinar.