It is narrated from Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "Kill snakes, and (especially) kill the one with two stripes and the short-tailed one, for these two cause miscarriage and take away eyesight."
Sayyiduna Ibn Umar (may Allah be pleased with them both) said: Abu Lubabah or Zayd bin al-Khattab (may Allah be pleased with him) saw me chasing a snake in order to kill it, and he stopped me. I said: The Messenger of Allah (peace and blessings be upon him) commanded that they be killed. He said: After that, he (peace and blessings be upon him) forbade killing the snakes that live in houses. Al-Zuhri said: By them are meant the snakes that settle in houses.
Hadith Referenceالمعجم الكبير للطبراني / باب الزاي / 4628