I have a website where I want to find out visitor's country from his IP address. There are some databases of country's IPs range that can be used. when I download them to my database, should I be woried about some changes made in future? How often are IP's range for countries actualized?

  • From my experience, very slowly. My country changed its name twice over the last 10 years (last change was in 2008) and there are still numerous location services that use older names which can cause all sots of problems for example: you can't ship to non-existing country, so there are web stores that take some effort to set up correctly because they try to auto-detect location, there are some sites that show wrong language because of bad interpretation for two letter country codes and so on. – AndrejaKo Jan 19 '12 at 6:26
  • 1
    Related questions, but about regions instead of countries: serverfault.com/questions/59167/…. The accepted answer says "They get reassigned very, very rarely, if at all". And another answer says: "But what happens more is that new IP ranges are assigned to new customers" — so the problem might be new IPs, rather than old that changes? – KajMagnus May 20 '15 at 3:21

IP addresses, postcodes, and the like, were not invented to directly encode geographical locations. That is, simply, not their purpose.

These things do change, and as you can see they change often enough for people to spot quite large errors from year to year. They also were never intended to represent countries in the first place. They represent the topgraphy of Internet network connections, not physical geography.

Then of course you have the difference between the end user's IP address and the back end of the HTTP proxy's IP address, on top of all that.

Further reading


I think you'd be better off using a geoip service that already exists rather than putting your own together - that way you don't need to concern yourself with maintaining the database.

An example is here, but there are many out there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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