However:
is a free service that relies on its users putting their own data in. A wiki like mechanism, if you will.
http://www.geody.com/geoip.php
appears to work, but I'd worry about their TOS.
http://www.maxmind.com/app/locate_ip
is one that I used (at least in demo mode), and it is much better than most. But it isn't cheap.
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.
You'd be amazed how many people in US are still on AOL. They all use IE and some of them are still on 56K modems.
I can provide it later if you'd like?
<script type="text/javascript" src="http://j.maxmind.com/app/geoip.js"></script>
<script type="text/javascript"> var country = geoip_country_name(); var state = geoip_region(); alert("State: "+state); </script>
updating monthly is a bit of a pain, but no real complaints. i'd recommend using mod_geoip since it's written in c
also I use the binary format of the database as recommended by maxmind, but one cool thing i was able to do with the the csv version was import it into my db and then use sphinx to build a full text searchable index of worldwide cities
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 :(
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.
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).
They're not 100% accurate, but you won't find a product that is. We are very happy with them and highly recommend them.