Narrated Abu Huraira (may Allah be pleased with him): The Prophet (peace and blessings of Allah be upon him) said: "Whoever keeps a dog, his reward will decrease by one Qirat every day, except for a dog kept for farming or for guarding livestock."
Narrated from Abu Huraira (may Allah be pleased with him) that the Messenger of Allah (peace and blessings of Allah be upon him) said: "Except for a dog (kept) for sheep, or farming, or hunting."
It is narrated from Sayyiduna Abu Hurairah (may Allah be pleased with him) in another narration as follows: "Except for a dog used for hunting or guarding livestock."