
The early sages drew a distinction between cities which were walled in the era of Joshua son of Nun and all other, unwalled, cities. The former celebrate Purim on the 15th of Adar and the latter on the 14th of Adar. The sage Rabbi Joshua son of Levi ruled that the cities Lod, Ono, and Gei Charashim were walled at the time of Joshua son of Nun. The scholars asked: Weren’t these cities built in the era later than that of Joshua son of Nun, as they were built by Alpa’el? It is written “Alpa’el…built Ono and Lod and its villages” ( I Chronicles 8:12). Answer: An argument should not be drawn from the Scriptures, for from another place we could conclude that Asa, king of Judea, built those cities: “He built fortified cities in Judah” (II Chronicles 14:5). [Their question is unclear, for Lod, Ono, and Gei Charashim” are not mentioned in the verse, and moreover, they are in the portion of the tribe of Benjamin, not Judah.] We should say, though, that Joshua built these cities and they were destroyed, Alpa’el rebuilt them and they were again destroyed, and Asa rebuilt them again. We can learn of their building and destruction and rebuilding from the verse “For [Asa] said to Judah, ‘Let us build these cities'” (II Chronicles 14:5). The phrase “Let us build these cities” shows us that the cities were pre-existing and Asa reconstructed them.
(Babylonian Talmud, Tractate Megillah 4a)