Is it permissible to keep a dog as a pet, and do some madhhabs allow it?
Halal & HaramQ&A answerQ&AEPIC Q&A Night9 Mar 2022kgg91QVF5MgThe video starts at 00:28, where this question begins.
Also on YouTube: Is There Any Leeway in Keeping A Pet Canine? | Ask Shaykh YQ - EP 265 ↗
The question as asked Of late, more and more Muslim families are beginning to acquire dogs as pets, and they say it is allowed in some schools of law. Is this true, and is there any concession? And how do we answer when our children say, "Why would the sharia prohibit owning a cute little puppy?"
The answer
So no doubt this is a very interesting question. It has been discussed in our books since the beginning of scholarship, and it also shows us the differences of cultures. Because I speak for most of us above the age of, I think, 30, 35, where we are accustomed to culturally look down upon dogs. I have never in my life wanted to touch a dog. I have never wanted to pet a dog. Every time I see a dog, I turn around and go the other way. I have no desire to interact with dogs. And I think most of us from that generation and older are the same way. Even though I was born here, still, I kind of caught the old vibe, if you like.
But our own children are saying they're the cutest creatures. I don't think they're cute, but our kids do. Our children are saying, why can't we have puppies? Why can't we have dogs? It's a cultural difference that we need to take into consideration.
Now, there's no doubt that culture sometimes plays a role. There is one of the maxims of fiqh, al-'urfu muhakkam: that 'urf, or culture, plays a role. But culture only plays a role where the sharia is silent. When the sharia, obviously the Qur'an and Sunnah, has explicit matters, then culture is put aside. Culturally speaking, certain cultures might think certain animals to be beautiful, other animals to be ugly. That's not a problem. But if the sharia comes and says a certain animal is haram, a certain animal is najis, that changes the entire paradigm.
So does the sharia say these types of issues explicitly, and what is this controversy? What exactly do our 'ulama say? So this will be a fairly detailed lecture. I always have to make the disclaimer: it's still intermediate level, not advanced level, but it'll be a fairly detailed lecture about this issue.
By the way, FYI, for your own curiosity, a number of books were written in our tradition about dogs. One of them has been translated into English, and it is a very interesting book. It was written by one of the judges of ancient Isfahan, Abdurrahman ibn Ali ibn Marzuban, and it is entitled Kitab Fadl al-Kilab 'ala Kathir mimman Labisa al-Thiyab. Who's going to translate this? The Superiority of Dogs over Many of Those Who Wear Clothes. This is Ibn Marzuban. He wrote a book, The Superiority of Dogs over Many Who Wear Clothes.
And the story of this book is actually very funny. I'll just summarize it. He and his friend were lamenting (this is 300 Hijrah, 1,100 years ago) how society has become corrupted. SubhanAllah, 1,000 years ago they're saying the good old days are gone. Can you imagine if they lived to our times? And that there's no such thing as a good person and loyal friends and whatnot. And Ibn Marzuban remarked, "I think some dogs are better than some men." And his friend istaghrab, he found this problematic. He goes, "No." "I'll prove it to you." And he wrote a book, and in this book he proved it, according to him.
So what he's talking about here is that dogs are loyal, dogs are happy with very little. Even if you're angry with a dog, he'll forgive you, all of these types of things. And he has all of these: Arabic poetry, he has athar of the Sahaba, he has ahadith as well. I'm just quoting from this book. Al-Ahnaf ibn Qays, one of the tabi'un, said: if your dog wags his tail at you, then you can be sure that his tail wagging is genuine, but do not trust the tail wagging of people; many of those who tail-wag at you are in fact treacherous in their hearts. Interesting point. Al-Sha'bi says (al-Sha'bi is the great scholar, 103 Hijrah): the dog's best characteristic is that he is never hypocritical. When he shows love, when he loves you, he's real, unlike people, men or women. Ibn Abbas said: a trustworthy dog is better than a deceitful man. And he goes on and on in this manner, trying to prove that some dogs are better than some. Anyway, that's Ibn Marzuban. I'm not saying this; I'm merely quoting.
Another famous book that was written about dogs in our tradition is by one of the great icons of the Hanbali school, Ibn Abdul Hadi, who was also one of the students of the students of Ibn Taymiyyah. He's also known as Ibn al-Mibrad; he died 902 Hijrah. And Ibn Abdul Hadi wrote a 300-page book called al-Ighrab fi Ahkam al-Kilab, or The Interesting Rulings about Dogs. 300 pages. It's a whole volume of fiqh, printed in Arabic obviously. And I just quoted and tweeted today rule number 72. Who saw rule number 72 online? Anybody? What is rule number 72? Rule number 72 in Ibn Abdul Hadi's book on dogs, 100 rules: if a person's dog defecates on the path, the owner of the dog is obliged to pick it up. So poop bags are shar'i; we can prove this from Ibn Abdul Hadi. Anyway, FYI.
So, serious note now. What does the Qur'an mention about dogs? The Qur'an mentions dogs in three places. One of them is relatively neutral, factual. One of them is somewhat praiseworthy. One of them is somewhat disparaging.
Of the places the Qur'an mentions a dog is, of course, Ashab al-Kahf. Factual: the people of the cave had a dog. So the guard dog is sitting outside the cave, and Allah 'azza wa jall sealed that cave. And:
سَيَقُولُونَ ثَلَاثَةٌ رَّابِعُهُمْ كَلْبُهُمْ وَيَقُولُونَ خَمْسَةٌ سَادِسُهُمْ كَلْبُهُمْ
So this is a factual statement, that the people of the cave had a dog. What if somebody were to say, "Aha! Allah mentioned the dog of the people of the cave. This shows that having a dog is halal"? Response: the people of the cave are not prophets, number one. Number two, they are people of a previous generation, and the sharia of a previous generation is not something that our sharia is necessarily for or against. It's neutral until we find evidence in our sharia.
But it does show that dogs were domesticated by people for many, many millennia, and this is well known. By the way, archaeologists and biologists know that dogs are of the earliest domesticated animals. There's only, how many domesticated animals? 10? There's literally only 10 or 15 domesticated animals in this world. The majority of animals are not domesticated, and they were all domesticated by humans eventually, over time. And the first domesticated animal was the dog, or the dog species. And we have remains of civilizations with dogs that go back 15,000 years. So dogs and humans have been together since the beginning of even recorded history, and Ashab al-Kahf proves this: that people have lived around dogs for very, very many millennia. So this is one time in the Qur'an.
As for the somewhat negative connotation, it is of course the parable of the dog in the Qur'an. The one who rejects the truth is compared to it: his example is like that of the dog. Whether you shoo him away or whether you don't, in both cases his tongue is going to be hanging out and he's going to be panting. In other words, what Allah is saying is the dog has no sense: whether you're angry or whether you're not, he's going to be panting and looking at you. So Allah is comparing the Quraysh to this type, and it's not a very positive connotation. So this is one, the second time.
The third time in the Qur'an where Allah mentions dogs, which is somewhat positive, is where Allah says in the Qur'an: they ask you what is halal for them, what is permissible for them in food (Surah al-Ma'idah). All good food is permitted for you, and it is also allowed for you to eat all that your beasts of hunting... Jawarih are all beasts that hunt, such as dogs and falcons. And what else hunts? Cheetahs. No, we can't train lions. In some cases we have trained cheetahs. So certain animals are able to hunt; very rarely we can do other animals as well. These are jawarih.
Now, mukallibina: Ibn Abbas said, trained dogs, mukallibin. This is one interpretation. The other interpretation: mukallibina means that which you have sent out to catch your prey. Tu'allimunahunna mimma 'allamakumullah: you have trained these animals, these dogs, from the knowledge Allah has given you. So the fact that we are able to train dogs, Allah is saying this is a knowledge you have. It's a blessing you have, that you are able to take these beasts and then train them to be your servants in this manner. They're going to hunt on your behalf. That's a blessing you have been given. And Ibn Qayyim also mentions: look at how knowledge even raises the status of a dog. Tu'allimunahunna mimma 'allamakumullah: the trained dog has different rulings than the untrained dog.
So this is the third time that dogs are mentioned in the Qur'an. These are the three places that dogs are mentioned in the Qur'an. From the Qur'an, all that we can extract is that it is halal to have hunting dogs. That's it. That's the Qur'an: it is halal to have hunting dogs. The Qur'an does not tell us anything else, by and large. We can use hunting dogs. And if we're allowed to own hunting dogs, and Allah is praising the fact that we have taught them from the knowledge Allah has given us, this shows us it is halal to train dogs ourselves. And training dogs takes years, by the way. It's not something that is overnight. Dog training is a speciality, and Allah has allowed it explicitly in the Qur'an and praised it. Think about this: tu'allimunahunna mimma 'allamakumullah, you are teaching these animals from what Allah has given you knowledge of. So the Qur'an explicitly allows it.
And the dog trainer (I want you to think about this, maybe even watch an educational video), the dog trainer has to be extremely friendly with the dog, earn the trust of the dog, physically interact with the dog. And clearly that much is explicitly allowed by the Qur'an. And then when you train the dog, the owner has to have a strong relationship, because dogs are very loyal to their owners, and especially guard dogs. They must know who is the family; they must know who is not the family. So the Qur'an is allowing one category explicitly.
As for the ahadith, the ahadith bring up the more detailed issues, and there are multiple aspects. Because of time, we'll only mention the two main ones that we should be aware of. Number one, the najasa of the dog, and number two, the opinion of the 'ulama about owning a dog. And the two are not the same. Something can be najis but you can still have it or see it or own it. So the najasa is one thing, and owning is another thing.
As for the najasa of the dog, note that we're not talking in this lecture about the urine or the stool of the dog. Al-Bayhaqi says, and al-Nawawi quotes him on this, "ajma'a al-Muslimun 'ala najasati bawli al-kalbi, wa kadhalika gha'itihi." So there is ijma', according to al-Bayhaqi, that the urine and the stool of the dog is najis. Footnote: there's a small dissenting voice in the Maliki school, but basically the bulk of the ummah says it is najis. We're not talking about the stool or the urine. We're talking about the animal: physically touching the animal, or the hair, the fur of the dog, or the saliva of the dog. That's what we're talking about.
With regards to the najasa of the dog, there are, from the beginning of Islam, three very famous opinions, three primary opinions that our madhahib have adopted. All of these opinions, by the way, center around and deal with the famous hadith in Bukhari and Muslim, the muttafaq 'alayh hadith: Abu Huraira said, the Prophet ﷺ said, if a dog slurps water in one of your canisters, then you must wash that canister seven times, the first time with sand. So you must wash that canister, you must wash that pot or bowl, seven times, the first of them with sand.
By the way, our scholars say the meaning of seven and turab is extra washing. In our times, if you use soap or you put it in the washing machine, it does the job. The point is an extra washing needs to be done, more than just rinsing and putting some water on. You need to scrub. Turab here, the purpose of turab is the scrubbing. You need to scrub it, and then use the pot or the pan. So if the dog licks a pot, eats from a bowl, you cannot use that bowl. You have to give it an extra washing, a severe washing, before it is pure to use. This is the hadith, muttafaq 'alayh.
From this hadith, three opinions. The first opinion is the Shafi'i school and the majority, or the default, or the mashhur, of the Hanbali school: two out of the four schools. They said, if the saliva of the dog is najis by this hadith, then clearly the entire dog has a special ruling and it is najis. So the dog, and the body of the dog, and the fur of the dog, and the saliva of the dog, all of it is najis. So if a dog brushes against your pants, you are not allowed to pray in those pants until you give them a severe wash. Change your clothes before you pray. This is the Shafi'i opinion and the default, or the mashhur, of the Hanbali school: Shafi'is and Hanbalis. By the way, generally speaking, Hanbalis and Shafi'is are overlapping on many of these issues.
The second opinion is the opinion of the Hanafi school; Abu Hanifa is explicit on this point. And it is also the position of Shaykh al-Islam Ibn Taymiyyah and al-Shawkani and other scholars of that strand. And they say that what is najis is the saliva of the dog, and only the saliva. As for the fur and the body, it is not najis. So if a dog brushes against you, you don't have to do anything; you can pray in that cloth. But if the dog licks you or your pants, then you cannot pray until... If it's your hand, you have to wash; if it's your pants, you have to change or wash.
So this is the second opinion, and this is the opinion of Ibn Taymiyyah, as we said, and the Hanafi position. Ibn Taymiyyah, in Majmu' al-Fatawa, volume 21, page 530, says: "The third opinion is that the fur of the dog is pure and its saliva is najis. And this is the madhhab of Abu Hanifa, it is one of the opinions of Imam Ahmad, and it is the most correct opinion. So if a person's thawb touches the body of the dog, even if it is moist with sweat, it doesn't become najis." End quote of Ibn Taymiyyah. So Ibn Taymiyyah says that even the sweat of the dog is not najis. So a wet dog is not najis, but the saliva of the dog is najis. Is that clear? That's position number two.
Obviously, what is left? The third opinion. Which madhhab is left? The Maliki school. And the Maliki school said nothing of the dog is najis. The dog is not najis, and its fur is not najis, and its saliva is not najis. Nothing is najis about the dog.
Okay, Imam Malik, great Maliki scholars, what do you say about this hadith, that it has to be washed seven times or whatnot? The Malikis respond to this in a number of manners. And by the way, there's a famous scholar in Morocco, Shaykh Sa'id al-Kamali. Everybody, all the Arabs, know him; he's very world famous. He has a number of good videos about this issue; you can listen to him. And he's also beloved by the Athari school as well, because he's a very erudite scholar of that tradition, and so he brings evidences that are very much in that genre. So Shaykh Sa'id says (I'm taking from his video, actually) that in his opinion, and this is again his opinion, the correct opinion is that there is nothing najis about the dog. And he goes: what about this hadith? How do we respond? He gives four responses, and this is from the earlier Maliki school.
Number one, he says that washing does not necessarily mean that it has to be najis. We should wash that which we might find disgusting, but it is not najis. So for example, mucus: it is not najis by unanimous consensus of the 'ulama, but it is something that, if we find it, we're going to wash it. So he said, just because we have to wash doesn't mean it is najis. That is the first point.
Secondly, he says: by explicit Qur'anic testimony, the trained dog is allowed to hunt. And how does it hunt? With what does it hunt? The mouth. And its mouth is going to have saliva, and the saliva is going to be right on the animal, and the sharia did not problematize that. And we don't have any text in the sharia that says, "Oh, make sure that you wash it seven times," even though yaqinan there's going to be saliva on that animal. And by text of the Qur'an, that animal is halal if you say bismillah when you send the dog. By the way, you still have to say bismillah; it's very explicit in the hadith, it's very clear. So the tasmiyah is mandatory. So this is point number two: the fact that the trained dog is allowed to hunt, and the saliva is going to be mixed up, and the sharia did not problematize that, indicates, according to the Maliki school, that the saliva is not najis.
Point number three, he said: Bukhari and Muslim have a hadith of Ibn Umar that the dogs would come in and out of the masjid of the Prophet ﷺ, and no one would do anything about that. Now, this might shock many of us here. We have to understand: rural Medina, a very different society. It's not like closed doors and air conditioning and five doors to get in and out. It's just very primitive, and dogs were everywhere. And Ibn Umar is telling us, in this authentic hadith of Bukhari and Muslim, well known, that dogs would come in and out of the masjid and nobody stopped them or put up a barrier. They would be seen regularly inside the masjid of the Prophet ﷺ. And if they were najis, they would not be allowed, or at least, just like when the Bedouin urinated, what did they do? They cleaned it, right?
Ibn Battal said (Ibn Battal is a great author of hadith, a scholar of hadith, died, don't quote me, 300 something), Ibn Battal says: the fact that the dogs would come and go to the masjid necessitates that they're going to be touching their noses, because they sniff everywhere, and they're going to be drinking water and eating leftover food, because the masjid was a sleeping place for strangers and delegations, and they would eat in the masjid and they would live in the masjid, and the Ahl al-Suffah had an entire section of the masjid. If the dogs were impure, they would have been prevented from entering the masjid, because Muslims unanimously agree you cannot allow something najis to enter the masjid knowingly. And the fact that they would come and go, as Ibn Umar says, indicates the repetitive nature of dogs entering and nobody forbidding them, which means that they were not najis al-'ayn, najis li-dhatihi. End quote. So this is another great scholar of early Islam saying this hadith shows that they didn't problematize dogs as being najis.
And fourthly, Shaykh Sa'id says that the fact that the Prophet ﷺ is saying wash it seven times, the first with sand, clearly indicates this is not because of najasa. Because which one is more najis and disgusting: human excrement, menstrual blood, versus the saliva of a dog? Which is more disgusting? It is the first. But we don't have to do that with the first, do we? We don't have to wash a vessel seven times, the first of them with turab, for something which is unanimously more najis. Even if you said that saliva is najis, what is more najis than that, you know what I'm saying, yet we're not commanded to do that.
Hence, he says, and he quotes Ibn Rushd, the famous Ibn Rushd. Ibn Rushd is a Maliki; Ibn Rushd the famous philosopher, Averroes. Ibn Rushd wrote one of the greatest books of fiqh, Bidayat al-Mujtahid, "The Beginning of the Mujtahid." This book, if you master it, you're ready to do ijtihad. Ibn Rushd was one of the great Maliki scholars of Andalus. He was the judge of Andalus as well, under the Muwahhids. And Ibn Rushd, no sorry, not under them; he was persecuted by them. Ibn Rushd wrote this book, and in it he says that the fact that we have to wash it seven times indicates it's not because it is najis. There must be some medical reason. And Shaykh Sa'id says this is because of bacteria: the only way to eliminate the bacteria is this. So it's not najis, it is disgusting, and not every disgusting thing is najis. There's a difference between the two. Something can be disgusting to us, but it's not najis. And he is saying, or the Maliki school says, that's dog saliva: it's not najis in and of itself.
So these are the three opinions. First opinion: everything of the dog is najis. Second opinion: only the saliva is najis. And the third opinion is the Maliki: the dog is not najis in the first place; nothing to do. Now, as you know, my position about the madhhab is that it's best to follow your own madhhab. Otherwise, if we open this door, it gets very confusing. Or you follow the shaykh whom you trust in this regard.
The second issue becomes: what is the fiqh, or the fatwa, of owning a dog? Because it's one thing about najis, it's another thing about owning a dog. When it comes to owning a dog, there are two ahadith that are used to discuss this issue. The first of them: whoever takes a dog, except for one of three, shall have the good deeds of his day diminished by the amount of a qirat. What is a qirat? It's like a large quantity. Whoever takes a dog, except if it is a dog of agriculture, or a dog of hunting, or a dog of protection, shall have his good deeds diminished by a certain amount every day.
So this is the first hadith: that if you take a dog without one of these three reasons, if you own a dog, if you possess a dog, then your good deeds of the day will be diminished. However many you've done, you're not going to get the full amount. There's going to be a deduction. There's going to be a penalty, a tax for owning that dog.
The second hadith, in Sahih Muslim: the Prophet ﷺ was waiting for Jibreel to come. One day he didn't come, and he became perturbed: why didn't Jibreel come? He went outside, and Jibreel was waiting for him outside. He said, "You said you were going to come; why didn't you come?" Jibreel said, "There is a dog in your house, and we do not enter houses that have dogs in them." And the Prophet ﷺ came in, and they found a puppy under the bed, so they put it outside. And so this shows us that, according to this, angels do not enter the house where there is a dog. So these are the two hadith that are used.
Now, from this, a number of things. First and foremost, by unanimous consensus, even the scholars that say it is najis allowed these three types of dogs: meaning the dog that is used for a purpose that is maslaha, clearly beneficial. You need a dog to control the perimeters, make sure you ward off any types of beasts from your land. You need a dog for hunting. You need a dog to protect your house, a guard dog. Even the Shafi'is, the Hanafis: the Qur'an allows it, nobody can deny it. The Qur'an allows it.
By the way, a hunting dog can also be for pleasure. It doesn't mean you're dying if you don't hunt. Most people who have hunting dogs might do it for pleasure, and Allah allows hunting dogs. Think about this point here. None of the scholars said you have to be dying of hunger, then you're allowed to own a hunting dog. That's ridiculous. It takes years to train a dog. Generally speaking, the people who do this are already upper middle class anyway, or they are people living in the badiya, and they take years to train the dog. Point being, by unanimous consensus it is allowed to own a dog that is benefiting your land or acquiring food for you. So that much is allowed.
What then do we do about other than these three? The vast majority of scholars said that anything that is reasonable, by qiyas upon these three, should also be allowed. Imam al-Nawawi said: scholars have differed, can we move beyond these three? And the correct opinion is, if there is a need, or not a need, maslaha, it's not a need, if there is a benefit to having a dog other than these three, then we make qiyas: that there is some benefit coming back to you. That benefit is not a darura, it is a haja. Haja means it makes life easier; darura means you cannot live without it. Haja means it makes life easier. So Imam al-Nawawi said any dog that is needed for a haja is allowed. Al-Nawawi is Shafi'i, and the Shafi'is were the strictest when it comes to dogs. Still, they said any dog that is for a haja. And this is pretty much all of the other madhahib as well.
So from this we can extrapolate that without a question, without a doubt, a seeing dog is halal to have. These days we're discovering there are those that are mentally or emotionally impaired, and sometimes having an animal makes them normal, mentally more balanced. They feel more stable or whatnot. Some people, they panic, and when they have their dog with them... I met somebody like this. I had no idea, I had no clue. A few years ago, I met one of our converts, and he had PTSD from battle. Long story. And he had a dog with him, and it was a special dog, marked. He could see normally. I'm like, what is this dog for? So he said, "It's my emotional comfort dog." Like, what's that? And he explained to me that because of PTSD, sometimes I hyperventilate, sometimes I panic, sometimes he loses control. And the dog senses the panic, and the dog comforts the owner. SubhanAllah, I had no idea of this. So, a therapeutic type of dog.
So without a doubt, this is a haja, without a doubt. If you're allowed to have a dog to go hunting for luxury items like rabbits or something of this nature, clearly you can have a dog when you're hyperventilating, or emotionally or whatnot. That there are people who, mentally, emotionally, need these types of creatures that bring about comfort: this must be completely permissible as well.
Now, generally speaking, the default of the Hanafi, Shafi'i and Hanbali schools is that a dog is only allowed for haja. Haja means, as I said, something you need, but not a life-and-death need. It's something that you can sense is going to bring a lot of ease to your life. In the Maliki school, once again, they were a little bit more open in this regard, and they lowered the bar more than the other schools. And of their great giants is Ibn 'Abd al-Barr. Ibn 'Abd al-Barr writes in his Tamhid, when he mentions this hadith about the three, that this implies that it is allowed to own a dog for all types of benefits. Whatever is going to be of benefit, you may then own the dog if a person wishes to do so. And if there is no benefit, then it is makruh according to them, not haram. Makruh to own the dog. And if there is benefit, then there is no karaha whatsoever. So this is the Maliki position.
And he mentions a very interesting point; I'm just going to quote this to you. This is Ibn 'Abd al-Barr. Ibn 'Abd al-Barr died in the year 436 AH, 1,000 years ago, and he's one of the giants. Every scholar knows him and every Maliki loves him. He's one of the great giants of the Maliki school, and he wrote the most voluminous commentary of Imam Malik's Muwatta; it's in like 25 volumes. He actually wrote two commentaries of the Muwatta of Imam Malik. And he writes in here that owning a dog for benefit, I do not think there is the slightest karaha. There is nothing makruh about owning a dog for benefit, because people have been owning dogs generation after generation, in every single land and in every single region, as far as we know. And throughout these lands and regions, scholars have seen this, and they did not prevent them from doing this, nor did they go to the sultans and stop them, even though they had the power to do so. However, he says: I do not like that a person own a dog except for a legitimate reason.
"Do not like" means I think it is makruh. So Ibn 'Abd al-Barr's position, which is fairly standard in the Maliki school, is that it is makruh to own a dog for no reason. And for any reason, for a manfa'ah (not a haja; it is lower than haja), for any benefit, owning a dog would then become, ya'ni, la ba's, not makruh. This is Ibn 'Abd al-Barr.
Now, okay, Ibn 'Abd al-Barr, what do you say about the hadith that the angels do not come inside? That's also there. Here we don't just have Ibn 'Abd al-Barr; we have quite a number of 'ulama, even before Ibn 'Abd al-Barr. We have Ibn Hibban. Ibn Hibban is one of the original scholars of hadith who narrated the hadith. Ibn Hibban is basically of the giants of hadith of the 5th, 10th century; he is not a scholar of fiqh. Ibn Hibban is the compiler of the Sahih. There are four sahih books, by the way: Sahih Bukhari, Sahih Muslim, Sahih Ibn Khuzaymah and Sahih Ibn Hibban. These are four sahih books; Ibn Hibban is one of the sahih.
Ibn Hibban has a chapter heading about this hadith. So he has the original hadith; he's not just commenting. He actually has the hadith with his isnad, and he then has the chapter heading (I'm just summarizing it, you can look this up) that this hadith is specific to the house of the Prophet, where wahi comes down. This is about Jibreel. Because it is impossible that the angels do not enter any house in which there is a dog: the Kiraman Katibin, he goes, are with them. The Kiraman Katibin are always with the people, even if there are dogs there. So this hadith is not unconditional.
And he brings another hadith, that the Prophet ﷺ said: any caravan that has dogs or bells will not have angels with it. Ibn Hibban says this is the caravan that the Prophet ﷺ is in; the angels will not be in such a caravan. Because it is impossible that the caravan of the hujjaj and mu'tamirin, which always has dogs or these types of things in it, that the angels will not come around them, because Allah has said these are My delegations, wafd Allah. So Ibn Hibban is saying this is Jibreel, who has the highest standard, and the Prophet ﷺ. It's not sharia for the rest of us. That's his position.
Ibn 'Abd al-Barr and others also brought this forth. Ibn 'Abd al-Barr comments, as for the hadith that the angels do not enter the house where there is a dog, he says: this, and Allah knows best, is why the Prophet ﷺ himself did not like having a dog in his house. And some have said this is khass for Jibreel and the Prophet ﷺ, Ibn 'Abd al-Barr says, and some have said it applies to all others. So the point being that this hadith has not been interpreted unanimously in the same manner.
Other scholars have added some other points about this hadith: that from this hadith, the max that one can derive, if we were to apply it to all houses (and not everybody applies it; some say only the Prophet ﷺ), is that the angels do not like this animal. However, you cannot extract tahrim from it, because what the angels do not like does not make it haram. For example, the angels do not like any strong odor, such as garlic, strong garlic. The angels do not like it. Is it haram? So a number of 'ulama have pointed out that the wording of the hadith does not indicate tahrim. The max, which Ibn 'Abd al-Barr says, is karaha: it is best to avoid these things.
Now, this is Ibn 'Abd al-Barr and a prominent strand of Maliki, or Sunni, Islam. But to be factual, it is a minority opinion. The majority of the ummah have said that these hadith mean that it is sinful to have a dog without a haja, and according to the majority opinion, to play with an animal is not a haja. You understand this point? So I'm being factual when I say the majority of the ummah would not allow a dog as a pet just to play with. But a strand of the Maliki school would not find it problematic. Some might say it is makruh, and makruh does not imply sin; it's best to avoid. And this is why some cultures of our Muslim world have permitted this and others have shut the door. Me personally, I think it is definitely best to avoid, simply because there's a number of hadith that are quite clear in this regard.
Before we conclude, one final point. There are two hadith that we also need to very quickly mention. There is a hadith that the Prophet ﷺ at one point in his life commanded dogs to be killed wherever they are found, and then later on he said, let them be. And Ibn 'Abd al-Barr interprets this, that this is because Jibreel refused to come into the house, so the Prophet ﷺ, on his own accord, wanted to get rid of them. Then Allah ﷻ told him, no, you shouldn't do that. Because the hadith says that dogs are one of the ummahs among all of the ummahs, so I'm not going to command them to be killed: the fact that the dogs are one of the ummahs, then I cannot kill all of them. So this hadith indicates that he was not allowed to do so.
And the final hadith, which we conclude on. The majority opinion is that dog saliva is najis, and because of that, even if we have a dog for haja, we should be careful about our prayer. So even if you have a dog for haja (a dog is guarding the house, a dog is hunting, a dog is for any type of haja), you must make sure, by the way, that you have an area in your house that the dogs do not enter, so that you can pray there. And if the dog licks you, because in my opinion dog saliva is najis, if the dog licks you, then you cannot pray until you change your clothes or you wash your hand, whatever it has licked. So there should always be that place.
But just because dog saliva is najis, this does not mean that the sharia has told us to be harsh or mean to dogs. On the contrary, people have entered Jannah by being kind to a dog. And we'll conclude on this famous hadith in Sahih Bukhari that we all know: that Allah subhanahu wa ta'ala forgave a prostitute for her kindness to a dog. This is in the hadith: she was walking in a land and she became very thirsty, and she saw a well. So she went into the well and drank from the water. She came out and she found a dog that was so thirsty it was licking outside of the well to get some water. She felt pity on the dog. She said to herself that this dog has felt just as thirsty as I was. So she went down into the well and she filled her shoe (she had nothing else), and she put her shoe in her mouth and climbed out to feed that dog.
Just imagine this. By the way, the hadith is very profound: not just the dog, but what the lady does, and her career, and her shoe in her mouth. Think about all of these, the type of thing she's doing to help just a beast. Nobody sees this; Allah is watching. And as the Prophet ﷺ said, Allah thanked her for that one deed and forgave her. One of them said, "Ya Rasulallah, will we get ajr for being kind to animals?" And the Prophet ﷺ said, "Yes, in every living beast there is ajr."
So this hadith shows us that we are not commanded to be nasty or mean or cruel to dogs. And it is completely permissible, if we see a stray dog, to feed it or whatever. And if you ask me personally, even if you pet it (not that I'm encouraging it; I personally don't, it's just my culture, whatever), but if you want to do it, I don't think it is najis at all. What is najis is the saliva. And if we are kind and merciful, Allah 'azza wa jall will be kind and merciful to us.
An edited transcript of the video, lightly cleaned up for reading. The video is the source; if the text and the video differ, the video is correct.
Related questions
Can a Muslim keep a dog to guard the home, or as an assistance dog for a special-needs child?
Can Muslims keep dogs in their homes?
Is it permissible to buy a dog with money?
Which animal leathers are permissible, and does tanning make an animal's skin pure?
Is it permissible to kill animals for medical research purposes?
Can I euthanize my cat that has cancer, and will I be with it in Jannah?
What are the najasat (ritual impurities), and what are their rulings?
Which leathers may Muslims use, and what is the default for leather sold in Western countries?