1,401. Questions Regarding Residents of Walled and Unwalled Cities

Hilchos Megillah v’Chanukah 1:10

If a resident of an unwalled city traveled to a walled city or vice versa, then if his intention was to return home for megillah reading in his city but he was ultimately unable to do so, he reads the megillah on the day they read it in his city. If his intention was not to return home until after the megillah was read, he should read it with the people of the city that he is visiting. If there are houses next to a walled city that are seen with it, then if there are no more than 2,000 cubits between them, they are considered part of the walled city and their residents read the megillah on 15 Adar.

Hilchos Megillah v’Chanukah 1:11

If there is a doubt as to whether or not a city was surrounded by a wall at the time of Joshua, the residents read the megillah on both 14 and 15 Adar, both at night and by day. They only recite the bracha when reading on 14 Adar because this is when the megillah is read in most of the world.