Search code examples
geolocationgeoipmaxmind

Incorrect results from geoLite2 IP database


Searching for IP 54.73.154.147 using latest GeoLite2 IP database I get the following results:

Seattle, US, United States

But the IP address is actually from a AWS server spun up in Ireland. If I submit the same IP to the GeoIP Precision test page (https://www.maxmind.com/en/geoip-demo) I get the correct results:

Dublin, IE, Ireland

Can anyone think of a reason as to why Im getting such erroneous results?


Solution

  • The reason that you are getting two different results is because they simply are different versions of databases and the one you search on their web interface is apparently more accurate and more up-to-date. GeoLite2 is not very accurate and you need to update it every week to receive accurate information since IP addresses are changing every minute. For example I purchased a few IP addresses and I can use one today and shift to another one tomorrow as I please. Bigger companies do that more often and most of these IP addresses can go from one country to another.

    And if you just want to stick with MaxMind product you can use this url to request the json:

    https://www.maxmind.com/geoip/v2.1/city/{{ip.address}}?use-downloadable-db=1&demo=1

    Note that only 25 requests are allow a day in theory (but easily hackable). Don't ask me how to hack it because it is against the rules of Stackoverflow.