The Prophet ﷺ said, "Do not undertake a journey except to three mosques, this mosque of mine, the Sacred Mosque, and the Aqsa Mosque."
عن النبي ﷺ قال: لا تشد الرحال إلا إلى ثلاثة مساجد مسجدي هذا، والمسجد الحرام، والمسجد الأقصى.
Bukhari narrated it in the Book of the Merit of Prayer in the masjid of Makkah and Madinah (1189), and Muslim in the Book of Hajj (1397), both from the hadith of Sufyan bin Uyayna, from Zuhri, from Saeed bin Musayab, from Abu Hurairah, mentioning the same.Muslim also narrated it through another route, from Salman Aghar, that he heard Abu Hurairah report that the Messenger of Allah ﷺ said, "One should only travel to three masjids, the masjid of the Kaaba, my masjid, and the masjid of Ilya." The masjid of Ilya is Bayt al-Maqdis.Another route for Abu Hurairah will follow, through Humayl bin Basra bin Waqqas.