Maxmind has a free and pay for use version of their service. It's excellent, has a Pear class you can use Net::Geo_IP (IIRC). Just install whatever version of their DB you need and you're all set. Have used it many times.
Give them a look as well.
Maxmind