Are you looking for zip code accuracy or just country accuracy? or something in between?<p>If all you want is what country the IP is from then go to <a href="http://www.ip2location.com/" rel="nofollow">http://www.ip2location.com/</a> and look through the forums. You can find out how to do it yourself.<p>If you need really fine granularity you will need a for pay service.
The Maxmind GeoIP database is what most people are using. It's quite accurate, has good libraries for many languages, but it's proprietary and costs money.<p>(Starting an open source competitor is on my list of fun projects to do)
<a href="http://www.hostip.info/" rel="nofollow">http://www.hostip.info/</a><p>Good if you're not completely sure of how much geolocation will do for you or you don't want to spend a fortune.
Low end: <a href="http://www.ip2location.com/" rel="nofollow">http://www.ip2location.com/</a>
High end: Akamai (akamai.com) has a ~$10k/month hyper-accurate solution.