62

We've got a requirement in a couple of our systems to detect a user's country based on their IP address. We'd prefer to use a database rather than a Web Service (to prevent issues with downtime/network access to an externally hosted service) so I'm looking for recommendations, anyone got any good or bad stories of the various IP to Country databases?

What I've found from google:

Paid

Free

Any information on how the free ones compare to the paid ones would be good. Right now I'm leaning towards Maxmind's paid service since it includes automatic updates that we can run via script once a week.

3

2 Answers 2

78

Totally free, LGPL, not easily found in google: ip2c.org

15
  • 43
    Webservice only, so it doesn't allow downloading the database
    – Redzarf
    Jul 27, 2015 at 17:33
  • 7
    Also does not support HTTPS.
    – Simon East
    Feb 19, 2016 at 5:30
  • 5
    It's not accurate for me: It says that I'm in UK but I'm in France. When I'm using Maxmind or ip2location it gives me the right answer.
    – Aalex Gabi
    Jul 4, 2016 at 8:35
  • 13
    @Redzarf: The download of their DB is here. Their Notes page mentions which DB they use. It's a bit hard to spot on the downloadpage, you need to look here.
    – RobIII
    Feb 12, 2018 at 15:57
  • 1
    It doesn't appear that ip2c.org supports ipv6. ipv6 addresses are used pretty frequently. Is there a reliable solution for ipv6 addresses as well? I'd rather an API (like ip2c.org) rather than downloading and maintaining the DB myself.
    – theyuv
    Mar 22, 2020 at 16:00
32

We use Maxmind and it's very good, and pretty accurate. You can get scenarios where, say, a German company has offices in the US but is using a German IP range for internal purposes. So, they'll report as Germany while being based in the US. It won't be 100% reliable.

3
  • Yeah we ended up going with Maxmind in the end. Seems like a good option. Nov 28, 2013 at 9:18
  • no, my city listed 5 times,
    – user965347
    Jun 1, 2015 at 19:35
  • 6
    You understand a city may have multiple ISPs, or multiple blocks even for a single ISP, right? It is not an error for your city to be listed 5 times!
    – Stéphane
    Oct 6, 2016 at 3:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.