title: How to do Geo IP or postcode lookup against Geonames data
body: <p>I am using the freely available <a href="http://geonames.org/" rel="nofollow">geonames</a> data locally to do autocomplete searches during the sign up stage on one of my websites.</p>
  
  <p>I am having trouble working out the best way to make the form more user friendly by auto selecting a geoname based on their IP address and also be able to lookup a geoname based on the <a href="http://www.geonames.org/postal-codes/" rel="nofollow">postcode data</a>.   </p>
  
  <p>The problem is that I can't see a way to easily link an IP range or a postal code to a geoname.  So what is the best practice here?  Do I just run a separate query to lookup the nearest geoname by long/lat against the postcode or IP address?</p>