Sunan an-Nasa'i, Book 42, Hadith 17 (In-Book) ⓘ
It was narrated from Ibn 'Umar that: The Messenger of Allah commanded that all dogs be killed except dogs used for hunting or herding livestock.
أَخْبَرَنَا قُتَيْبَةُ، قَالَ حَدَّثَنَا حَمَّادٌ، عَنْ عَمْرٍو، عَنِ ابْنِ عُمَرَ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم أَمَرَ بِقَتْلِ الْكِلاَبِ إِلاَّ كَلْبَ صَيْدٍ أَوْ كَلْبَ مَاشِيَةٍ .
also referenced under: Hadith 4279 (Reference) & Volume 5, Book 42, Hadith 4284 (DarusSalam)