Narrated Abdullah ibn Masud: The Prophet ﷺ said: Kill all the snakes, and he who fears their revenge does not belong to me.
Related hadith on this topic
Explanation & Benefits
Hafiz Muhammad Ameen
(1) Domestic snakes are exempted from this ruling because in authentic narrations, killing them has been prohibited. It is possible that this hadith is from an earlier period. As for those snakes whose killing is permitted, one should not fear their retaliation; however, those whose killing has been prohibited should not be killed, whether there is a risk of retaliation or not. The relevance of this narration to the Book of Jihad is that one may encounter snakes during travel.
(2) “He is not from among us” means he is not upon our way. We do not fear retaliation from snakes, nor should Muslims fear it. The researcher of the book has declared this narration weak in its chain of transmission and has further written that the narrations of Sunan Abi Dawud, numbers: 5248 and 5252, suffice in this regard. Therefore, despite this narration being weak in its chain, it is still actionable. And Allah knows best.
Source: Sunan Nasa'i: Translation and Benefits by Shaykh Hafiz Muhammad Amin Hafizullah, Page: 3195