From Sahih Muslim (Hadith 5829):
Nafi' reported that Ibn 'Urnar used to kill all types of snakes until Abu Lubaba b. 'Abd al-Mundhir Badri reported that Allah's Messenger (ﷺ) had forbidden the killing of the snakes of the houses, and so he abstained from it
Reference: Muslim 5829