Sayyiduna Abdullah bin Mughaffal (may Allah be pleased with him) said that the Messenger of Allah (peace and blessings be upon him) said: "If dogs were not a community among the communities, I would have ordered that all dogs be killed, but now you should only kill the completely black dog." Sa'id bin 'Amir said: «بهيم» That is the dog which is completely black.
Imam Nawawi rahimahullah said: There is consensus among the scholars that a biting dog should be killed.
Imam al-Haramayn said: The Messenger of Allah sallallahu alayhi wa sallam initially commanded the killing of all dogs, then this was abrogated, and the black dog remained under that ruling.
After this, it was established which type of dog should be killed—so long as it does not cause harm, even the jet-black one, and the reason for the reduction in reward is that the angels do not enter a house in which there is a dog. Some have said that the reason is that people are harmed by its barking and attacking.
As for the statement that “if it were not for being a community among the communities,” its meaning is that the dog is also a type of species, that is, a category of the world, and its complete extinction is not possible. Therefore, issuing a command to kill (all of them) is futile; no matter how many you kill, dogs will certainly remain in the world as long as the world exists. You see that snakes and scorpions, lions and wolves—people have been killing them wherever they find them for hundreds of thousands of years, and hundreds of thousands of rupees are given as reward for killing them, but have these species disappeared from the world? No, never.