There are a bunch of API services out there that are able to determine the latitude and longitude (and other data, e.g. state, city, etc.) for a given IP address. How are they able to do this? How does one know what part of the world an IP address is associated with?
Good-ish article in this Stackoverflow article[0]. The short version is: Any website that has your location (e.g. city, address, etc) can sell that data on and do.<p>In the US in particular there are nearly no data protection laws (except healthcare records). So companies "share" data with impunity.<p>[0] <a href="https://stackoverflow.com/questions/1996106/how-does-ip-geolocating-work" rel="nofollow">https://stackoverflow.com/questions/1996106/how-does-ip-geol...</a>
First of all you can do a whois on an IP address to get where the company that registered is located.
If you traceroute the address you can sometimes get hints on where it is.
And then some big sites may use geo locotation services on their websites that query the browser/APP GPS where the user is located and then it may be concluded that the whole /24 net is within that area and then the site will sell this information to geo location services.
You can download a DB with this info here: <a href="http://dev.maxmind.com/geoip/geoip2/geoip2-csv-databases/" rel="nofollow">http://dev.maxmind.com/geoip/geoip2/geoip2-csv-databases/</a><p>I integrated that into my own webserver so I get fun logs; there's a tingle when you see people reading your own posts after all.<p>You can also buy a bigger, better DB from the same people.