Query localization is an improved extension of on-demand routing protocols for ad hoc networks. It makes use of prior routing histories to localize the query flood to a limited region of a network. However, the lifetime of the found route by two existing query localization approaches tends to be much shorter than that of network-wide flooding. In this paper we address this shortcoming and provide an improved solution through analyzing the routing overhead incurred by network-wide flooding. The analytical results clearly show the superiority by adopting query localization in routing. We also perform experimental simulation in NS-2 simulator to validate our theoretic analysis and to evaluate the performance of the proposed solution. Categories and Subject Descriptors C.2.2 [Network Protocol]: Routing Protocols General Terms Theory, Performance, Algorithms, Design. Keywords Analysis of routing overhead, ad hoc networks, on-demand routing protocols, flooding, query localization optimizati...