“I heard the Messenger of Allah (ﷺ) raising his voice and commanding that dogs be killed, and dogs were killed, except for hunting dogs or dogs kept for herding livestock.”
Sunan Ibn Majah Book 28, Hadith 4