None of them are very good, at least partly because things are so aggregated through ISPs. For instance, ALL AOL users appear to be in Herndon (?), VA<p>However:<p><a href="http://www.hostip.info/" rel="nofollow">http://www.hostip.info/</a><p>is a free service that relies on its users putting their own data in. A wiki like mechanism, if you will.<p><a href="http://www.geody.com/geoip.php" rel="nofollow">http://www.geody.com/geoip.php</a><p>appears to work, but I'd worry about their TOS.<p><a href="http://www.maxmind.com/app/locate_ip" rel="nofollow">http://www.maxmind.com/app/locate_ip</a><p>is one that I used (at least in demo mode), and it is much better than most. But it isn't cheap.<p>There are more folks out there -- they end up being used by fraud-prevention outfits by filtering out IPs from places with known credit card abuse issues.
I'm a little late to the party but I'm a co-founder of Digital Envoy (www.digitalenvoy.net). The company was acquired last year (Landmark Communications) but we invented the field of IP location technology back in 1999. The company's technology is generally considered the best available and has shown to be more accurate in head-to-head competitions. Of course, it isn't free but it isn't ridiculously expensive. Performance on Digital Envoy's stuff beats anyone else out there (hence the great customer list). Not sure why I keep selling for them since I no longer work there so for what it's worth, take a look.
I've used <a href="http://www.maxmind.com/" rel="nofollow">http://www.maxmind.com/</a>
They have a free older database of IPs you can download (usually a month out of date - -but good enough for stuff I've needed)
Maxmind has a free javascript one to detect cities and states...the cities are a little off but the state is always dead on.<p>I can provide it later if you'd like?
I tried the built-in ip address geocoding in the Rails plugin, GeoKit.<p>It's relatively accurate except for when the visitor is accessing the site from a corporate or school network, in which case it shows up where their main ISP hub is, which could be across the US. Unfortunately that's a large percentage of our users, so it just ended up confusing most of them. We had to remove that feature :(
Maxmind is good, we use 3 of their products on getclicky.com. They all have straight forward APIs, and are very easy to setup and use within your own application.<p>GeoIPCity - returns city, country, "region" (state in the US), lat/long, area code, zip code, and more. This is available for free, or ~$400 for the full version, which is considerably more accurate, within the US at least. The free version is still pretty damn good considering it's free. The paid version is updated weekly, free is monthly.<p>We also use the "organization" and "hostname" products, which tell us for example that someone is from "Comcast Cable" and their hostname is "comcast.net", or "Google Inc" and "google.com", etc. These products are not available for free but they are pretty cheap ($15 for the hostname and $80 for the organization I think).<p>They're not 100% accurate, but you won't find a product that is. We are very happy with them and highly recommend them.