Reference : Hisn al-Muslim 208

أللّـهُمَّ رَبَّ السَّـمواتِ السّـبْعِ وَما أَظْلَلَـن،
وَرَبَّ الأَراضيـنَ السّـبْعِ وَما أقْلَلْـن،
وَرَبَّ الشَّيـاطينِ وَما أَضْلَلْـن،
وَرَبَّ الرِّياحِ وَما ذَرَيْـن،
أَسْـأَلُـكَ خَيْـرَ هذهِ الْقَـرْيَةِ
وَخَيْـرَ أَهْلِـها،
وَخَيْـرَ ما فيها،
وَأَعـوذُ بِكَ مِنْ شَـرِّها
وَشَـرِّ أَهْلِـها،
وَشَـرِّ ما فيها
Allāhumma Rabbas-samāwātis-sab`i wa mā aẓlaln, 
Wa Rabba ‘l-arāḍīnas-sab`i wa mā aqlaln, 
wa Rabbash-shayāṭīni wa mā aḍlaln, 
wa Rabbar-riyāḥi wa mā dharayn. 
As'aluka khayra hādhihi ‘l-qaryah, 
wa khayra ahlihā, 
wa khayra māfīhā, 
wa a`ūdhu bika min sharrihā, 
wa sharri ahlihā, 
wa sharri mā fīhā.


O Allah, Lord of the seven heavens and all they overshadow,
Lord of the seven worlds and all they uphold, 
Lord of the devils and all they lead astray,
Lord of the winds and all they scatter. 
I ask You for the goodness of this town, 
and for the goodness of its people, 
and for the goodness it contains. 
I seek refuge in You from its evil, 
from the evil of its people, 
and from the evil it contains.

Reference:
Al-Hakim who graded it authentic and Ath-Tfaahabi agreed 2/100, and Ibn 
As-Sunni (no. 524). Al-Hafidh graded it good in his checking of Al-'Athkdr 
5/154. Ibn Baz said in Tuhfatul-'Akhydr p. 37, that An-Nasa'i recorded it 
with a good chain of narration.

Chapter: Upon entering a town or village