Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
tabarani:269[Chain 1] Abū Yazīd al-Qarāṭīsī > ʿAbdullāh b. ʿAbd al-Ḥakam > Mālik [Chain 2] ʿAlī b. ʿAbd al-ʿAzīz > al-Qaʿnabī > Mālik > Ibn Shihāb > ʿAbd al-Ḥamīd b. ʿAbd al-Raḥman b. Zayd b. al-Khaṭṭāb > ʿAbdullāh b. al-Ḥārith b. Nawfal > ʿAbdullāh b. ʿAbbās > ʿAbd al-Raḥman b. ʿAwf ؓ

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. (Using translation from Abū Dāʾūd 3103)  

الطبراني:٢٦٩حَدَّثَنَا أَبُو يَزِيدَ الْقَرَاطِيسِيُّ ثنا عَبْدُ اللهِ بْنُ عَبْدِ الْحَكَمِ أنا مَالِكٌ ح وَحَدَّثَنَا عَلِيُّ بْنُ عَبْدِ الْعَزِيزِ

ثنا الْقَعْنَبِيُّ عَنْ مَالِكٍ عَنِ ابْنِ شِهَابٍ عَنْ عَبْدِ الْحَمِيدِ بْنِ عَبْدِ الرَّحْمَنِ بْنِ زَيْدِ بْنِ الْخَطَّابِ عَنْ عَبْدِ اللهِ بْنِ الْحَارِثِ بْنِ نَوْفَلٍ عَنْ عَبْدِ اللهِ بْنِ عَبَّاسٍ عَنْ عَبْدِ الرَّحْمَنِ بْنِ عَوْفٍ ؓ قَالَ سَمِعْتُ رَسُولَ اللهِ ﷺ يَقُولُ «إِذَا سَمِعْتُمْ بِهِ بِأَرْضٍ فَلَا تَقْدَمُوا عَلَيْهِ وَإِذَا وَقَعَ بِأَرْضٍ وَأَنْتُمْ بِهَا فَلَا تَخْرُجُوا فِرَارًا مِنْهُ»  


See similar narrations below:

Collected by Muslim
muslim:2219dYaḥyá b. Yaḥyá > Mālik > Ibn Shihāb > ʿAbdullāh b. ʿĀmir b. Rabīʿah

'Umar went to Syria and as he came to Sargh, information was given to him that an epidemic had broken out in Syria. 'Abd al-Rahman b. 'Auf narrated to him that Messenger of Allah ﷺ had said: When you hear of its presence in a land, don't move towards it, and when it breaks out in a land and you are therein, then don't run away from it. So 'Umar b. Khattab came back from Sargh. Salim b. 'Abdullah reported that 'Umar went back, along with people on hearing the hadith reported on the authority of 'Abd al-Rahman b. 'Auf.  

مسلم:٢٢١٩dوَحَدَّثَنَا يَحْيَى بْنُ يَحْيَى قَالَ قَرَأْتُ عَلَى مَالِكٍ عَنِ ابْنِ شِهَابٍ عَنْ عَبْدِ اللَّهِ بْنِ عَامِرِ بْنِ رَبِيعَةَ

أَنَّ عُمَرَ خَرَجَ إِلَى الشَّامِ فَلَمَّا جَاءَ سَرْغَ بَلَغَهُ أَنَّ الْوَبَاءَ قَدْ وَقَعَ بِالشَّامِ فَأَخْبَرَهُ عَبْدُ الرَّحْمَنِ بْنُ عَوْفٍ أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ إِذَا سَمِعْتُمْ بِهِ بِأَرْضٍ فَلاَ تَقْدَمُوا عَلَيْهِ وَإِذَا وَقَعَ بِأَرْضٍ وَأَنْتُمْ بِهَا فَلاَ تَخْرُجُوا فِرَارًا مِنْهُ فَرَجَعَ عُمَرُ بْنُ الْخَطَّابِ مِنْ سَرْغَ وَعَنِ ابْنِ شِهَابٍ عَنْ سَالِمِ بْنِ عَبْدِ اللَّهِ أَنَّ عُمَرَ إِنَّمَا انْصَرَفَ بِالنَّاسِ مِنْ حَدِيثِ عَبْدِ الرَّحْمَنِ بْنِ عَوْفٍ