Network

Geolocate IP: what it means and how to do it

Geolocate IP: what it means and how to do it

Each device directly connected to the Internet is assigned a public IP address: this address allows you to reach the device from any other host remote. Systems connected to one stay ON they share, thanks to the mechanism known as NAT (Network Address Translation), the same public IP that is assigned to the main router. Each device connected to the local network presents itself to remote systems with the public IP assigned to the router but internally to the network it uses a Private IP.

Geolocation and public IP

We have already seen how to find your IP address: among the many tools for read the public IP, we suggest ipify.org which can detect and display both IPv4 and IPv6 addresses. “But what if I don’t want to search for my IP but for that of another user?”, is one of the most “popular” questions.

As we have already seen some time ago in the article containing instructions on how to find out where a person is from their IP address, theIP address of other users can be found in many ways, for example by examining headers (header) of email messages (this is not a suggestion that can always be applied in every case…) or, often, by analyzing network traffic with a tool like WireShark.

Geolocalizzare IP it means establishing the geographical position associated with a public IP address: all the largest companies (and not only) use this approach (also) to estimate where a user is physically located.

Online services that use IP geolocalization tools: why they do it

For example, Google search results are personalized based on geographic location of the user: in this way the search engine can provide more relevant results depending on where a person is located.

Furthermore, the main video streaming platforms use the IP geolocation to determine whether or not the connected client has the right to access the contents. As we saw in the article on cross-border portability, in fact, the various networks that offer media streaming services they also check the IP address associated with the user’s device: if it belongs, for example, to a country other than Europe – for licensing reasons – different contents are shown or access is not permitted at all (or vice versa it is permitted, depending on the commercial agreements that each platform has in place).

Hence the great interest on the part of a large portion of users for i VPN services: Often opposed by online streaming platforms, third-party VPNs generally allow you to overcome the geographical limitations and unlock access to content not normally accessible from Europe or other nations.

However, there is also the flip side of the coin: the geolocation of IP addresses is not always possible it needs e reliable. Subscribers to some Europen streaming platforms who in recent weeks have suddenly found themselves in theinability to use the services regularly paid. Why? Because the public IP addresses assigned to them by their respective telecommunications operators were recognized as foreign (therefore no longer Europen) by the various online video platforms.

IP geolocation has in fact become increasingly popular complicated: we will explain the reason shortly.

How IP geolocation services work

I geolocation services IP addresses use a variety of techniques to determine the geographic location associated with a particular IP address. In general, these services collect information on how the different computer networks are connected to each other and on the ways in which they are organized geographically. IP geolocation services can use the following techniques:

  • Geolocation database: This approach consists of using databases that contain information about the geographic location of a wide range of IP addresses. These databases can be created using information from regional registries, Internet service providers, content providers and other sources.
  • Route tracking (routing): This technique uses information about the network routes used by IP packets to determine the geographic location associated with a public IP address. For example, the geolocation service can analyze information from routing used by IP packets between a source computer and a remote server to determine the approximate geographic location of the IP address. Of the tracerouting we talk for example in the article where we explain how to investigate lost packets or packet loss.
  • Browser-based geolocation: In this case, data shared by your web browser is used to determine your approximate geographic location. If the user agrees to send this information, the GPS position provided by the browser can be directly taken into account, where available (for example on mobile devices).

The reliability of the IP geolocation result may vary depending on the technique used and the quality of the data available. In general, services of this type are able to determine the approximate geographic location of an IP address within a few kilometers to several hundred kilometers.

Why it is useful to geolocalize IP

Geolocating IP is however useful in many circumstances:

  • Access control: Companies can use geolocation to limit access to their resources to only devices located in certain geographic areas.
  • Traffic analysis: website operators may use geolocation to obtain information on the origin of visitors, for example for statistical or advertising purposes; or to prevent registrations or access to services from the countries from which they originate spammer or attacks.
  • Safety: IP geolocation can be used to detect suspicious activity or intrusions from addresses belonging to unauthorized geographic areas.

How to locate IP: the best online services

There are various online tools and services that allow you to geolocalize an IP address: some of these are actively used by streaming platforms and many other entities to establish the geographic location of the client.

Among the absolute best is MaxMind GeoIP2: just paste the list of IP addresses to verify into the appropriate box to obtain the corresponding estimated geographical position in a few seconds. The Locate My IP Address service, also offered by MaxMindallows you to locate your IP address and verify the reliability of the control mechanism.

Alternatively, we suggest using IPInfo.io, another service that provides information on ownership of an IP address, including the approximate geographic location, the name of the corresponding Internet Service Provider (ISP), and more. The web application also returns the response in JSON format: developers can thus use theoutput in real time in their respective applications.

Database for IP geolocation

Geolocation Database is a tool available for free online that allows you to roughly estimate the location of an IP address public. There are two on the page spreadsheets rather heavy in CSV format that contain references to all IP blocks and their corresponding geographical position.

Geolocate IP with a CSV spreadsheet

One spreadsheet refers to IPv4 addresses while the second refers to IPv6 addresses. For each record there is the information in the figure and the last column gives a clue to theaccuracy of the estimate.

It goes without saying that this data, continuously updated on the site, can be imported into a database and used to carry out self-checks on the location of the client IPs that connect to their apps.

From a developer’s perspective, an even better way that returns more accurate results is to lean on a worker Cloudflare. All requests sent to Cloudflare contain approximate information about the client’s IP location. This data can be easily used in your own applications. We talked about it in the article dedicated to serverless web applications.

Why IP geolocation can fail

We said previously that IP geolocation can sometimes return results…

Leave a Reply

Your email address will not be published. Required fields are marked *