Killing dogs except dogs used for hunting or farming Sunan Ibn Majah 3201

Arabic hadith text
حَدَّثَنَا مُحَمَّدُ بْنُ بَشَّارٍ، حَدَّثَنَا عُثْمَانُ بْنُ عُمَرَ، ح وَحَدَّثَنَا مُحَمَّدُ بْنُ الْوَلِيدِ، حَدَّثَنَا مُحَمَّدُ بْنُ جَعْفَرٍ، قَالاَ حَدَّثَنَا شُعْبَةُ، عَنْ أَبِي التَّيَّاحِ، قَالَ سَمِعْتُ مُطَرِّفًا، عَنْ عَبْدِ اللَّهِ بْنِ مُغَفَّلٍ، أَنَّ رَسُولَ اللَّهِ ـ صلى الله عليه وسلمـ أَمَرَ بِقَتْلِ الْكِلاَبِ ثُمَّ قَالَ ‏"‏ مَا لَهُمْ وَلِلْكِلاَبِ ‏"‏ ‏.‏ ثُمَّ رَخَّصَ لَهُمْ فِي كَلْبِ الزَّرْعِ وَكَلْبِ الْعِينِ ‏.‏قَالَ بُنْدَارٌ الْعِينُ حِيطَانُ الْمَدِينَةِ
Translation
It wasnarrated from ‘Abdullah bin Mughaffal that the Messenger ofAllah(ﷺ) commanded that dogs be killed, then he said

“What do theyuse dogs for?” Then he permitted them to keep farming dogs and dogsof‘Ein. Bundar said: “The ‘Ein refers to the walls ofAl-Madinah.”