1

Is there a way to block (aside from a virtual network) websites from detecting locations? How does the website tell its servers what info to load based on location?

More specifically I have a website that I obtain JSON from to create an Excel file. Recently the website has made itself location specific, so the JSON I generate is for my location only and there is no way within the website to change locations.

I am wondering how I could go about trying to create the JSON of a "master list" of all locations. In other words somehow over-riding the default location it assigns to me.

2 Answers 2

6

How does the detection of an IP location work?

There are databases that match the IP address to the geolocation and services that offer matching IP to its location. This GitHub project lists those services.

Getting a geolocation of an IP address is as easy as querying, for example: http://freegeoip.net/xml/8.8.8.8 and that's what the website you are accessing is most possibly doing (where the data comes from and its accuracy depends on the database).

The response is:

<Response>
  <IP>8.8.8.8</IP>
  <CountryCode>US</CountryCode>
  <CountryName>United States</CountryName>
  <RegionCode>CA</RegionCode>
  <RegionName>California</RegionName>
  <City>Mountain View</City>
  <ZipCode>94035</ZipCode>
  <TimeZone>America/Los_Angeles</TimeZone>
  <Latitude>37.386</Latitude>
  <Longitude>-122.0838</Longitude>
  <MetroCode>807</MetroCode>
</Response>

Is there a way to block (aside from a virtual network) websites from detecting locations?

This question boils down to "is there a way to hide my real IP address and appear as a one saved in the databases under a different location?"

Yes, as you already know it, you can do it mostly with VPN or some other routing/forwarding, but in either case you must (somehow) control the end-node.

You can also try using Tor network, however these nodes can easily be blocked by the server providing you the data (and likely the service providing the geolocation would indicate the request is for an IP being a Tor exit node).

How does the website tell its servers what info to load based on location?

Having obtained the location of an IP address requesting the data, it's just a matter of a simple query taking into account for example CountryCode, RegionCode, and City from the above result.

2
  • Of course, such databases usually don't know if an address is anycast and exists in dozens of places at once – making 8.8.8.8 a pretty bad example. Dec 10, 2016 at 8:11
  • @grawity I'm not sure I understand. What address should I use to give an example on SuperUser?
    – techraf
    Dec 10, 2016 at 8:14
0

There is no detection of IP address location

There is no way to generate the location of a host from a random IP address somehow. The whole "detection" process is a mere database query about the range of IP addresses.

Every registered range of IP addresses has additional info.

  1. Your ISP registers an IP scope in a bigger network (let's say, RIPE)
  2. The ISP specifies public info (including the location) of the scope in the respective database
  3. When you connect to the Internet, the ISP leases an IP address to you
  4. A website (or any host you are connecting to) can make a query to the database in order to find public info about the scope

That info contains the location information. Normally it is the city your ISP is located in, and not the exact point.

The best way to "trick" a website about your location is to use a different public IP address. There are services (inclusing free ones, check friGate Chrome extension for example) providing some kind of proxy/VPN access.

3
  • this is not entirely correct. There are many ways to do it - Google and cellphone providers do it by reference to cell towers and/or known WIFI hotspots. You can also get partway there by knowing something about the Internet connection type and connectivity - some of this is available on maps, AS numbers [diverse routing path management], reverse DNS. Once you can get a good part of the way there, latencies can hint at where you are. For example, I live in Auckland, NZ. I know the latencies of my connections. BASED ON LATENCY, traceroutes and known Internet geography
    – davidgo
    Dec 10, 2016 at 8:54
  • I can tell if someone is in or near Auckland, Wellington, the South Island, East coast of Australia or West coast of America - even without reverse DNS. I can make better-then-country level guesses with high accuracy by using DNS and traceroute.
    – davidgo
    Dec 10, 2016 at 8:55
  • @davidgo I might not be clear. The point was - there is no way to somehow "detect" a geo location from an ip address, aside from looking it up in the database. If you have a working host and you can connect to it - there are many techniques how to investigate its properties, including physical location as well. But it is another story, the question was "detection of an IP address location".
    – enkryptor
    Dec 10, 2016 at 9:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .