The four schools tie keeping a dog to a need; they differ on guarding, pets, and purity
The four schools agree that keeping a dog is tied to a real need, such as hunting, guarding livestock or crops, and they differ on how far that need extends and on whether the dog is ritually impure. The Hanafis permit hunting, livestock and crops by consensus and treat guarding as a need, though Ibn Abidin says one should not keep it inside the home, while the Shafi'i view counted more correct permits guarding houses and roads and the Hanbali Kashshaf al-Qina' forbids keeping a dog even to guard houses except for livestock, hunting or crops. On purity, the Hanafis hold the dog not impure in itself and the Malikis hold it pure, while the Shafi'is and Hanbalis hold it impure yet permit keeping it out of need.Shamela+10
What the Quran says
The verse most used in this discussion is the one on hunting: "Lawful for you are [all] good foods and [game caught by] what you have trained of hunting animals which you train as Allah has taught you. So eat of what they catch for you, and mention the name of Allah upon it, and fear Allah." Al-Marghinani in al-Hidaya takes the phrase "mukallibin" (those who train dogs) as the textual basis for hunting with trained dogs and beasts of prey, and al-Qurtubi, as quoted by IslamOnline, read the same verse as showing that keeping and training dogs is lawful, from which he derived that buying, selling and otherwise benefiting from them is permitted.Quran.com+2
The other Quranic mentions are narrative, not legislative. In the story of the cave, the dog is described stretching its forelegs at the entrance, and the disputed number of the sleepers is given with the dog as the last of them; Ibn Kathir, as quoted by IslamQA, said the dog was included in their blessing because it kept company with righteous people, and al-Shanqiti drew from it a lesson about the benefit of accompanying the righteous. The dog in Surah al-A'raf is a parable of the one who follows his desires, panting whether chased or left alone.Quran.com+3


7 sources
Quran.comQuran 5:4, Al-Maaida
Shamelaالهداية في شرح بداية المبتدي، المرغيناني، ج4 ص401
IslamOnline Fiqhحكم تربية الكلاب للهواية
Quran.comQuran 7:176, Al-A'raaf
Quran.comQuran 18:18, Al-Kahf
Quran.comQuran 18:22, Al-Kahf
IslamQAWhat is the point of mentioning the dog in the story of the people of the Cave?
What the hadith show
The Prophet ﷺ ordered dogs killed except a hunting dog, a sheep dog or a livestock dog (Sahih Muslim 1571, sahih), and Ibn al-Mughaffal's narration adds that he then granted permission for hunting and sheep dogs (Sahih Muslim 1573a, sahih). "Whoever keeps a dog, except a dog for herding livestock or a hunting dog, a qirat is deducted from his deeds every day," with Abu Hurayra adding "or a dog for farming" (Sahih Muslim 1574d, sahih); another route has two qirats (Sunan an-Nasa'i 4284, graded sahih), and Muslim's version through al-Zuhri includes farming in the Prophet's own words (Sahih Muslim 1575b, sahih).Sunnah.com+4
On the vessel: "If a dog drinks from the vessel of one of you, let him wash it seven times" (Sunan an-Nasa'i 63, sahih); at-Tirmidhi's version adds that the first or last washing is with soil and was graded hasan sahih by him, and a Muslim narration has "and rub it with dust the eighth time". On angels: "The angels do not enter a house in which there is a dog or a picture" (Sunan an-Nasa'i 5347, sahih); Aisha's report that a puppy under the bed kept Jibril from coming is in Bukhari and Muslim, and Ibn Majah's version is graded hasan sahih.Sunnah.com+5
On black dogs, Jabir's report says the Prophet first ordered killing dogs, then forbade it and restricted it to the pure black dog (Sahih Muslim 1572, sahih), and "were it not that dogs are a community among the communities, I would have ordered them killed" (Jami' at-Tirmidhi 1486, hasan sahih); the same hadith in Abu Dawud 2845 is graded daif by Zubair Ali Zai but sahih by al-Albani and Shu'ayb al-Arna'ut, and Abu Dharr's question about the pure black dog was answered, "It is a devil" (Sunan Ibn Majah 3210, sahih). On mercy to dogs, there is the man who gave a thirsty dog water and was forgiven (Sahih al-Bukhari 6009, sahih), the prostitute of the Children of Israel forgiven for the same (Sahih Muslim 2245b, sahih), and the Prophet's answer, "In every moist liver there is a reward".Sunnah.com+6

18 sources
Sunnah.comSahih Muslim 1571: The Book of Musaqah
Sunnah.comSahih Muslim 1574d: The Book of Musaqah
Sunnah.comSunan an-Nasa'i 4284: The Book of Hunting and Slaughtering
Sunnah.comSahih Muslim 1575b: The Book of Musaqah
Sunnah.comSahih Muslim 1573a: The Book of Musaqah
Sunnah.comJami' at-Tirmidhi 91: The Book on Purification
Sunnah.comSunan an-Nasa'i 5347: The Book of Adornment
Sunnah.comSunan an-Nasa'i 63: The Book of Purification
Sunnah.comRiyad as-Salihin 1686
Sunnah.comSunan Ibn Majah 3651: Chapters on Dress
Al-FatawaHow to reconcile the narrations of the hadith regarding a dog drinking from a vessel
Sunnah.comSahih Muslim 2245b: The Book of Greetings
Sunnah.comSunan Ibn Majah 3210: Chapters on Hunting
Sunnah.comSahih Muslim 1572: The Book of Musaqah
Sunnah.comSunan Abi Dawud 2845: Game (Kitab Al-Said)
Sunnah.comJami' at-Tirmidhi 1486: The Book on Hunting
Sunnah.comRiyad as-Salihin 126
Sunnah.comSahih al-Bukhari 6009: Good Manners and Form (Al-Adab)
How the four schools rule
The Hanafis permit keeping a dog for hunting, livestock and crops "by consensus," and permit it when one fears a thief, though Ibn Abidin says one "should not" keep it in one's house; guarding is treated as a need, but keeping it inside the home is discouraged. The Imam's view, and the fatwa, is that the dog is not impure in itself and its hair is pure, though its leftover water is impure and the vessel is washed three times.Shamela+3
The Malikis permit keeping a dog for hunting, livestock and guarding, with guarding included among the permitted reasons. Malik held living creatures pure and read the seven washings as an act of worship without a rationale of impurity, and he was reluctant even to wash fat or milk a dog had touched; Dar al-Ifta al-Misriyya summarises this as Imam Malik holding the dog pure.Shamela+2
The Shafi'is permit the three by consensus, and "the more correct view" is that guarding houses and roads is permitted, including buying a puppy for that purpose, while it is disliked to keep a hunting dog for one who does not hunt. The dog is impure in itself, and game its mouth has touched must be washed seven times with earth.Shamela+2
The Hanbalis permit keeping a dog only for hunting, livestock or farming, and Kashshaf al-Qina' states it is forbidden to keep a dog, "even to guard houses," except for livestock, hunting or crops. The dog is impure, and the vessel is washed seven times, one with earth.Shamela+2
On selling dogs, the Hanafis validate the sale of dogs, while the Hanbali al-Mughni reports the sale as invalid and lists al-Shafi'i among those who held that, and the Maliki al-Dusuqi reports that a dog may not be sold, unlike a hunting dog according to some. Within the Hanbali school, Ibn Qudama himself set out two possibilities for someone who keeps a dog to guard property he does not yet own.Shamela+3

17 sources
Shamelaحاشية ابن عابدين = رد المحتار - ط الحلبي، ابن عابدين، ج5 ص226
Shamelaالمغني لابن قدامة - ت التركي، ابن قدامة، ج6 ص356
Shamelaروضة الطالبين وعمدة المفتين، النووي، ج3 ص346
Shamelaالشرح الكبير للشيخ الدردير وحاشية الدسوقي، محمد بن أحمد الدسوقي، ج3 ص447
Shamelaكشاف القناع عن متن الإقناع - ط وزارة العدل، البهوتي، ج7 ص307
Shamelaحاشية ابن عابدين = رد المحتار - ط الحلبي، ابن عابدين، ج1 ص207
Shamelaمغني المحتاج إلى معرفة معاني ألفاظ المنهاج، الخطيب الشربيني، ج2 ص339
Shamelaالمدونة، مالك بن أنس، ج1 ص115
Dar al-Ifta (Egypt)تربية الكلاب بغرض الحراسة
Shamelaالمغني لابن قدامة - ت التركي، ابن قدامة، ج1 ص73
Shamelaالهداية في شرح بداية المبتدي، المرغيناني، ج1 ص25
Shamelaحاشية ابن عابدين = رد المحتار - ط الحلبي، ابن عابدين، ج1 ص209
Shamelaروضة الطالبين وعمدة المفتين، النووي، ج3 ص241
Shamelaالشرح الكبير للشيخ الدردير وحاشية الدسوقي، محمد بن أحمد الدسوقي، ج3 ص11
Shamelaالمغني لابن قدامة - ت التركي، ابن قدامة، ج6 ص357
Shamelaالمغني لابن قدامة - ت التركي، ابن قدامة، ج6 ص352
Shamelaالهداية في شرح بداية المبتدي، المرغيناني، ج3 ص77
How scholars reconciled the evidence
The command to kill dogs is read as abrogated or as a temporary measure: Jabir's narration itself says the Prophet later forbade killing them, and the "community among the communities" hadith shows the command was withheld. Al-Marghinani explains the prohibition on selling them at the beginning of Islam as a way of breaking people's attachment to keeping dogs, and IslamOnline reports the same reading.Shamela+3
The qirat deduction is read two ways: Ibn Abd al-Barr and the Malikis took it to show dislike rather than prohibition, since a forbidden thing would not merely reduce reward, while the majority took it as evidence of prohibition, and Ibn Hajar in Fath al-Bari allowed that the deduction equals the sin incurred. The qirat itself is explained as a known portion of reward whose extent is known to Allah, compared in another hadith to Mount Uhud.IslamQA+1
The three named exceptions are extended by some and restricted by others: al-Nawawi, Ibn Abd al-Barr and Ibn Uthaymeen extended them by the reasoning of need, so that guarding a house or a person is a fortiori permitted, while Ibn Baz restricted the permission to crops, livestock and hunting and did not allow a guard dog for a palace. This is a difference over the ratio of the ruling, not over the hadith's authenticity.Shamela+3
Impurity and permission are held together differently: the Hanafis say the dog is not impure in itself but its saliva is, which is why it can be kept and even sold while its bowl must be washed, the Malikis call the washing devotional and the dog pure, and the Shafi'is and Hanbalis hold the dog impure yet permit keeping it out of need. AMJA notes that a dog kept for a valid reason does not make one's clothes problematic by mere contact, but its dishes must be washed seven times with soil or soap.Shamela+6
The angels' hadith is narrowed to the angels of mercy: al-Nawawi said the angels meant are those who bring mercy, blessings and forgiveness, while the recording angels never leave a person, and IslamQA notes that this specification is the commentators' inference from the full body of texts, not the Prophet's own wording. The practical reconciliation with permission is that the dog kept for a need is housed outside the living space, which is what the recent fatwas advise.IslamQA+2


20 sources
Shamelaروضة الطالبين وعمدة المفتين، النووي، ج3 ص346
Shamelaحاشية ابن عابدين = رد المحتار - ط الحلبي، ابن عابدين، ج1 ص207
IslamQAحكم اقتناء الكلاب
Shamelaمغني المحتاج إلى معرفة معاني ألفاظ المنهاج، الخطيب الشربيني، ج2 ص339
Shamelaالمدونة، مالك بن أنس، ج1 ص115
Dar al-Ifta (Egypt)تربية الكلاب بغرض الحراسة
Shamelaالمغني لابن قدامة - ت التركي، ابن قدامة، ج1 ص73
Sunnah.comSahih Muslim 1572: The Book of Musaqah
Sunnah.comJami' at-Tirmidhi 1486: The Book on Hunting
Shamelaالهداية في شرح بداية المبتدي، المرغيناني، ج1 ص25
Shamelaالهداية في شرح بداية المبتدي، المرغيناني، ج3 ص77
IslamOnline Fiqhالاتجار في الكلاب بين اختلاف الفقهاء ومقاصد الشرع
IslamQARuling on keeping a dog outside the house as a pet
IslamQA.orgThe meaning of ‘one qirat reward’
Al-FatawaThe ruling on keeping a dog for guarding the home and detecting criminals
IslamQAحكم اقتناء الكلب لتنبيه المريض إلى وقت حدوث نوبة الصرع
AMJAPets
IslamQAما حكم اقتناء الكلب للحراسة الشخصية؟
SeekersGuidanceWhat Is Intended by “The Angels’ Refusal to Enter Homes”?
IslamQAما المقصود بالملائكة في حديث «لا تدخل الملائكة بيتًا فيه كلب ولا صورة»؟
What recent fatwas say
IslamQA's 2005 answer permits keeping a dog only for hunting, livestock or crops and adds that guarding a house is permitted by analogy, and its 2025 answer on personal protection allows a dog for a woman facing harassment while requiring it to be housed in an outdoor shelter, since the need is outside the house. Its 2020 answer allows a seizure-alert dog for an epileptic woman, with care to avoid its saliva on body and clothes, and a 2009 answer discusses a convert's elderly dog that might be killed if released; a 2025 answer affirms that one following the Maliki view on saliva may pray in clothes it touched.IslamQA+4
Dar al-Ifta al-Misriyya, in fatwa 3093 of 2016, permits keeping dogs inside the home for guarding, notes the majority view of impurity against Imam Malik's view of purity, and treats the place where the dog is as pure on the Maliki position. The Assembly of Muslim Jurists of America states that dogs cannot be taken as pets but may be kept for farm, sheep, guard, hunt or guide purposes.AMJA+2
The Hanafi-oriented Darul Iftaa Deoband and Muftionline permit a dog for hunting, farm and house guarding but not as a pet, and Askimam permits a dog for security while saying a pet dog is not allowed. The Jordanian Ifta permits dogs only for a legal purpose such as guarding or hunting, while Ibn Baz's answer restricts permission to the three cases and questions police dogs.IslamQA.org+5


14 sources
IslamQAحكم اقتناء الكلاب
Dar al-Ifta (Egypt)تربية الكلاب بغرض الحراسة
Al-FatawaThe ruling on keeping a dog for guarding the home and detecting criminals
IslamQAحكم اقتناء الكلب لتنبيه المريض إلى وقت حدوث نوبة الصرع
AMJAPets
IslamQAما حكم اقتناء الكلب للحراسة الشخصية؟
IslamQAتريد الاحتفاظ بالكلب في بيتها كي لا يقتله القائمون على حقوق الحيوان
IslamQAHe follows the Maliki madhhab in the view that a dog’s saliva is not impure (najis). Is it permissible for him to pray wearing clothes that a dog’s saliva got on to?
AMJAPet Dogs
IslamQA.orgIs it permissible to keep a dog for security purposes?
IslamQA.orgIs it allowed to keep a dog as a pet in Islam?
IslamQA.orgWhat is the ruling on raising dogs inside houses by some people?
IslamQA.orgHaram Dogs vs. Permissible Guard Dogs in Islam
IslamQA.orgKeeping dog for security purpose