Sunan Ibn Majah, Book 28, Hadith 4 (Ibn Majah 3205)

It was narrated from Salim that his father said:

“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.”