It is narrated from Sayyiduna Ibn Umar (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "Kill snakes."
Sayyiduna Ibn Umar (may Allah be pleased with them both) said: Then Abu Lubabah and Zayd bin al-Khattab (may Allah be pleased with them both) saw me while I was killing a snake that lived in the house, and we used to call them 'jinnan', and they said: O Abdullah! The Messenger of Allah (peace and blessings be upon him) has forbidden killing the snakes that live in houses.
Hadith Referenceالمعجم الكبير للطبراني / باب الراء / 4484