Live data from Hacker News

How to build a IP geolocation database from scratch?

ipapi.is

21–30 of 186 posts

Re: How to build a IP geolocation database from scratch?

#21

Interesting but this isn't actually how geolocation is done, right? The ARIN/RIPE data isn't sufficiently accurate to be useful beyond country. Commercial geolocation involves correlating client IP vs known physical location e.g. from WiFi AP or mailing a package to the user. At least that's what I have been told over the decades.

I work in adtech and this is how we do geolocation. There's also device geolocation but if the user doesn't consent to sharing their GPS data with us, we just use IP address for targeting. Common provider for this is Maxmind; they ship a database that you host locally and query

Re: How to build a IP geolocation database from scratch?

#22

If you don't want to do this yourself, you can actually just get Cloudflare to do it for you for free using a simple Worker since all Cloudflare requests contain approximate IP location information. You can also just send a request to my URL (Cloudflare Worker operated - so it should have global low latency): https://www.edenmaps.net/iplocation Use it for small applications, I don't mind. Just don't start sending me…

Or you download an IP database rather than sharing with a third party which IP address is likely connecting to your service with a third party

Re: How to build a IP geolocation database from scratch?

#27

Any suggestions for geolocating datacenter IPs, even very roughly? I'm analysing traceroute data, and while I have known start and end locations, it's the bit in the middle I'm interested in. I can infer certain details from airport codes in node hostnames, for example. It would also be possible - I guess - to infer locations based on average RTT times, presuming a given node's not having a bad day. Anyone have any o…

This looked promising:

"TULIP's purpose is to geolocate a specified target host (identified by IP name or address) using ping RTT delay measurements to the target from reference landmark hosts whose positions are well known (see map or table)."

https://tulip.slac.stanford.edu/

But the endpoint it posts to seems dead.

Re: How to build a IP geolocation database from scratch?

#28

Any suggestions for geolocating datacenter IPs, even very roughly? I'm analysing traceroute data, and while I have known start and end locations, it's the bit in the middle I'm interested in. I can infer certain details from airport codes in node hostnames, for example. It would also be possible - I guess - to infer locations based on average RTT times, presuming a given node's not having a bad day. Anyone have any o…

> A couple of troublesome example IPs are 193.142.125.129, 129.250.6.113, and 129.250.3.250. They come up in a UK traceroute - and I believe they're in London - but geolocate all over the world.

If I'm running a popular app/web service, I would have my own AS number and I will have purchased a few blocks of IP addresses under this AS and then I would advertize these addresses from multiple owned/rented datacenters around the world.

These BGP advertisements would be to my different upstream Internet service providers (ISPs) in different locations.

For a given advertisement from a particular location, if you see a regional ISP as upstream, you can make an educated guess that this particular datacenter is in that region. If these are Tier 1 ISPs who provide direct connectivity around the world, then even that guess is not possible.

You can see the BGP relationships in a looking glass tool like bgp.tools – https://bgp.tools/prefix/193.142.125.0/24#connectivity

If you have ability to do traceroute from multiple probes sprinkled across the globe with known locations, then you could triangulate by looking at the fixed IPs of the intermediate router interfaces.

Even this is is defeated if I were to use a CDN like Cloudflare to advertise my IP blocks to their 200+ PoPs and ride their private networks across the globe to my datacenters.

Re: How to build a IP geolocation database from scratch?

#29
post #2

Step 1: Download Geolocation Database

Step 1: Download Geolocation Data Unless you think CSV is a database?

If in your mind database implies a type of technology and not something conceptual, you’re really just outing yourself as someone that needs someone between you and the boardroom. Certainly not something to show off on Hacker News.

Re: How to build a IP geolocation database from scratch?

#30

Interesting but this isn't actually how geolocation is done, right? The ARIN/RIPE data isn't sufficiently accurate to be useful beyond country. Commercial geolocation involves correlating client IP vs known physical location e.g. from WiFi AP or mailing a package to the user. At least that's what I have been told over the decades.

I work in adtech and this is how we do geolocation. There's also device geolocation but if the user doesn't consent to sharing their GPS data with us, we just use IP address for targeting. Common provider for this is Maxmind; they ship a database that you host locally and query

Does Cloudflare have the same data as Maxmind?

Because Cloudflare and Maxmind geolocate me to the exact same longitude/latitude.

Post reply on HN