Jami` at-Tirmidhi, Book 18, Hadith 30 (Tirmidhi 1515)

Narrated Ibn 'Umar:

"The Messenger of Allah (ﷺ) ordered killing dogs, except for the hunting dog, or the dog that guards livestock." It was said to him: "Abu Hurairah would say: 'or a farm dog' so he (Ibn 'Umar) said: "Abu Hurairah had a farm."