Sunan Ibn Majah, Book 28, Hadith 6 (Ibn Majah 3207)

It was narrated from ‘Abdullah bin Mughaffal that the Messenger of Allah (ﷺ) said:

“Were it not that dogs form one of the communities (or nations – of creatures), I would have commanded that they be killed. But kill those that are all black. There are no people who keep a dog, except for dogs used for herding livestock, hunting or farming, but two Qirat will be deducted from their reward each day.”