Nafi' reported that Ibn 'Urnar used to kill all types of snakes until Abu Lubaba b. 'Abd al-Mundhir Badri reported that Messenger of Allah ﷺ had forbidden the killing of the snakes of the houses, and so he abstained from it. (Using translation from Muslim 2233e)
«أَنَّ رَسُولَ اللهِ ﷺ نَهَى عَنْ قَتْلِ الْجِنَّانِ الَّتِي فِي الْبُيُوتِ»