Is it permissible to keep a dog to guard houses?
An-Nawawi (rahimahullah) said:
There is a difference of opinion as to whether it is permissible to keep dogs for purposes other than these three, such as for guarding houses and roads. The most correct view is that it is permissible, by analogy with these three and based on the reason that is to be understood from the hadeeth, which is necessity.
Sharh Muslim, 10/236
Shaykh Ibn Uthaymeen (rahimahullah) said:
Based on this, if a house is in the middle of the city there is no need to keep a dog to guard it, so keeping a dog for this purpose in such situations is haraam and is not permitted, and it detracts one or two qiraats from a person’s reward every day. They should get rid of this dog and not keep it. But if the house is in the countryside and there is no one else around, then it is permissible to keep a dog to guard the house and the people who are in it; guarding the members of the household is more important than guarding livestock or crops.
Majmoo Fataawa Ibn Uthaymeen, 4/246
There are several scholarly views about reconciling the reports which say â€œone qiraatâ€ and those which say two qiraats.
Al-Haafiz al-‘Ayni (rahimahullah) said:
(a) It may be that they have to do with two types of dogs, one of which could cause more harm than the other.
(b) It was said that two qiraats applies in cities and villages, and a qiraat applies in the countryside.
(c) It was said that they were said at two different times a qiraat was mentioned first, then the warning was made more strict and two qiraats were mentioned.
Umdat al-Qaari, 12/158.
And Allah knows best.