Sunan Abi Dawud 3103
Grading supplied with this record: Sahih (Al-Albani)
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
إِذَا سَمِعْتُمْ بِهِ بِأَرْضٍ فَلاَ تُقْدِمُوا عَلَيْهِ وَإِذَا وَقَعَ بِأَرْضٍ وَأَنْتُمْ بِهَا فَلاَ تَخْرُجُوا فِرَارًا مِنْهُ "
Narrated 'Abd Allah b. 'Abbas:
That 'Abd al-Rahman b.'Awf said: I heard the Messenger of Allah (ﷺ) say: When you hear that it is breaking out in a certain territory, do not go there. If it breaks out in the territory you are in, do not go out fleeing away from it. By "it" he referred to the plague.
Full reference and source
Sunan Abi Dawud 3103 In-book : Book 21, Hadith 15 English translation : Book 20, Hadith 3097
View source on Sunnah.com (opens in a new tab)