Hacker News new | ask | show | jobs
by xp84 746 days ago
It is very cheap and easy. Even the free versions of the database available from maxmind are plenty accurate for town level.

At my last job, I built a little docker image that used the free maxmind DB and kept it up to date, and ran a node server which returned some JSON telling estimated lat/long, city name, country, etc.

1 comments

Cheap, easy, and wrong. It puts me a clear 800km away from where I'm actually sitting, and I'm sitting in a major UK city.

It's put me on the wrong continent before now. That was fun.

Cheap, easy, and generally correct for the majority of people*

Just because it’s 800km off for your IP does not mean it’s 800km off for every IP and Maxmind is generally considered one of the reliable providers of this information.

I guess the accuracy really depends on your location or ISP.

I believe my ISP rarely or never rotates IP addresses, and on top of that I think my ISP provided router is assigned an IPv6 address and it prioritizes using it, because when I visit whatismyipaddress.com with JS disabled, it can only show my IPv6 address, but if I enable JS it can show an IPv4 address too (I assume through the WebRTC IP leak method, which requires JS)

When I built the thing I mentioned, and even if i did so now, I'd just not make an AAAA record for it, because it's still safe to assume ipv4 connectivity exists (and not just via some remote proxy or something), and I think at least the database I had access to was for ipv4.

I don't think they need any hackery to get your IPv4, they just need a separate hostname configured that they can fetch from, which only has an ipv4 (A) record.

Where do we locate you? https://ipinfo.io/

If the location data is incorrect, you can always submit a correction with us: https://ipinfo.io/corrections

Mine was about 600 km wrong but the correct country at least. It's reporting the ISP's location but it's a country wide ISP.
If you reach out to support and drop a correction with us, that will be quite helpful. This is an unusually high deviation, so we would like to investigate it.
Better! Still 200km out, but better!
200 KM means there is room for improvement. If you reach out to support and provide a correction, that will be quite helpful. If you mention that you came from HN, I can report back on why we had such a deviation.
> It's put me on the wrong continent before now

What did you expect after leaving Europe? /s