How to Find The Location Of Your Servers with Traceroute and WHOIS

Introduction

Making sure that any servers you deploy for your company’s or your development needs are in a location that works for you is among the most crucial factors to take into account. What would you do if, after deploying a server, you used an IP geolocation website and discovered that the IP address of your server did not correspond to its location?

Unfortunately, some websites can be extremely wrong despite being convenient. This tutorial will demonstrate some more precise techniques for locating your server.

Prerequisites

VPS running Linux, FreeBSD, or Windows with a fixed IP address.

How IP Addresses Are Assigned Locations

IANA is responsible for distributing all of the IPV4 and IPV6 addresses to five distinct regional internet registries (RIR).

The following are the 5 RIRs’ names and areas of responsibility:

USA, Canada, the Caribbean, and Antarctica (ARIN)

AFRINIC – Africa

ASIAN, AUSTRALIA, AND NEW ZEALAND CONFERENCE

Europe, Russia, the Middle East, and Central Asia make up RIPE NCC.

The RIR that is in charge of the region where an organization’s equipment will be located sells blocks of IPs to organizations. The organization is then in charge of updating the RIR’s database with information on the (country, state/territory, and city) locations of the IP addresses they have assigned.

Sites that employ IP geolocation make use of this data as their main data source. They frequently also use other sources, such as data mining and user-submitted updates, so it’s not the only one they employ.

Geolocation Website Issues

The fact that it is simply too difficult to keep track of so many IPs is one of the greatest problems with geolocation websites. There are a total of 4,294,967,296 IPv4 addresses that might be used, and many of them are continouslly being relocated, sold, or transferred to new businesses, etc. All of this travel can cause the geolocation sites’ databases to quickly become out of sync. One of the more popular IP geolocation services, IP2Location, states that “generally, the accuracy will decline by around 1%-5% for each month that an outdated database is being used.”

That adds up to about 200 million outdated IP addresses at any given time. Other websites that use IP2Location’s information might not have the most recent version and could be more than six months behind.

Organizations that may not be current with updating their RIR can also be a problem, leading to additional erroneous data.

As per ARIN and RIPE policies, Atlantic.Net maintains its direct allocations by updating the SWIP data in the relevant WHOIS database for the country, city, and state where the IP allocation was provisioned.

How To Locate Your Server’s True Location

These steps can be used to confirm the location of your server if a geolocation site provides you with inconsistent information regarding the IP address’s location.

Using WHOIS to check your IP

An IP address block or domain name’s registration information is stored in a database that may be searched using the WHOIS tool.

WHOIS should be preinstalled on FreeBSD systems. A straightforward command will allow you to install WHOIS on a Linux system:

For Ubuntu and Debian: 

apt-get install whois

For Fedora, Redhat, and CentOS:

yum install whois

For Linux Arch:

pacman -S whois

Windows: 

Unfortunately, Windows lacks an integrated WHOIS utility. You can use a third-party tool or visit the RIR in charge of the area where your server is situated to use their WHOIS tool. Below are links to each website. Simply choose one, enter your IP address, and it will inform you which RIR to use if you are unsure which one to use.

APNIC, LACNIC, AFRINIC, RIPE NCC, and APNIC.

Now that WHOIS is set up on your computer, you may use the command line to search the WHOIS database:

whois your-ip-address

The command’s output will look somewhat like this when you run it:

NetRange:       209.208.0.0 - 209.208.127.255

CIDR:           209.208.0.0/17

NetName:        ICC-1

NetHandle:      NET-209-208-0-0-1

Parent:         NET209 (NET-209-0-0-0-0)

NetType:        Direct Allocation

OriginAS:

Organization:   Atlantic.net, Inc. (INCC)

RegDate:        1998-04-13

Updated:        2012-02-24

Comment:        ADDRESSES WITHIN THIS BLOCK ARE NON-PORTABLE

Ref:            http://whois.arin.net/rest/net/NET-209-208-0-0-1

You can see that Orlando, Florida has been given ownership of this IP range in this specific instance. However, this outcome only provides you with a limited amount of details; the output may indicate that something is in one place while it is actually in another. The next action is to perform a traceroute for that reason.

Finding Your Server’s Location by Running a Traceroute

A traceroute is the most effective method for determining the location of your server. You can find out the sequential list of network devices—possibly run by various companies—through which traffic is routed as it travels to its destination by doing a traceroute.

Here, we’ll be able to view the route that traffic travels from your server to the IP or hostname you specify as the destination. To confirm that the location is accurate, we can perform a WHOIS on each IP address along the line.

Run the following command on Linux or FreeBSD to perform a traceroute:

traceroute your-destination-site-or-IP

Open your command prompt and enter the following command to perform a traceroute on Windows:

tracert your-destination-site-or-IP

The result of a traceroute from a London-based Atlantic.Net Cloud server to Google.com is as follows.

traceroute to google.com (216.58.210.46), 30 hops max, 60-byte packets

 1 vl223-ar-02.lon-uk.as59764.net (185.73.36.34) 0.401 ms 0.391 ms 0.464 ms

 2 84.207.244.73.not-updated.eunx.net (84.207.244.73) 1.048 ms 1.028 ms 1.001 ms

 3 195.66.224.125 (195.66.224.125) 1.410 ms 1.391 ms 1.372 ms

 4 209.85.247.31 (209.85.247.31) 4.172 ms 1.329 ms 1.316 ms

 5 72.14.238.21 (72.14.238.21) 1.290 ms 1.340 ms 1.323 ms

 6 lhr14s23-in-f14.1e100.net (216.58.210.46) 1.221 ms 1.339 ms 1.318 ms

On the IPs that appear in the traceroute, you may now perform a WHOIS search. The first few IPs should have WHOIS information because they will be closer to your server than the last few. A sample WHOIS from the second hop is shown below, indicating that the IP’s location is in London.

UK-EUNETWORKS is listed under “netname,” and Great Britain is listed under “country.” Once more, this depends on organizations accurately updating their information. With most traceroutes, you should have numerous hops you can check if anyone’s IP lookup looks to produce erroneous information.

What exactly is a traceroute?

A straightforward yet sophisticated command-line tool for tracing an IP packet’s travel across one or more networks is called a traceroute. A traceroute is another common name for the results of these instructions. Your ISP might request a traceroute if you contact them for assistance with, for example, poor streaming video performance.

How to Use Traceroute and Interpret the Results

The Internet we know and love is wirelessly delivered to consumers all over the world every second by trillions of 1s and 0s zipping via fiber-optic lines, skipping from continent to continent over undersea cables, and more. Have you ever considered the precise means through which those data fragments travel from one location to another? By following the route taken by your computer to a certain location, a tool called Traceroute, which you may already own, can provide some information. This article will explain what a traceroute is, how it operates, how to use it on various platforms, and how to interpret a traceroute output.

What does traceroute serve as a tool for?

Traceroute is usually used for diagnostics, but it may also be a fun tool for networking education or just to sate nerdy curiosity.

Using traceroute, system administrators and network engineers may monitor how traffic moves within a company and spot any strange or inefficient routes. When used externally, a traceroute can show a packet’s route over numerous networks and, in certain situations, even the various cities or geographical areas that the traffic passes through. The types of packets utilized by traceroute are routinely banned or filtered at the perimeter of corporate networks because attackers may theoretically use them to map out a target’s network.

The majority of traceroute implementations also provide the duration of each “hop” between the source and destination. Finding the source of dropped traffic or performance issues with this is helpful.

How to use Windows to run a traceroute

The traceroute utility is implemented slightly differently on Microsoft platforms than it is on Mac/Linux/Unix systems. The command itself shows the biggest difference: Instead of entering the entire term, you’ll use the “tracer” command on a Windows computer. Here is a detailed instruction:

  • Launch a command-line window. Using the Start menu’s search box, type “command,” or press Windows Key+R and type “cmd.”
  • Type “tracert” at the command-line prompt, then the hostname or IP address you want to trace to. For instance, we might type “tracert varonis.com” to examine the route to the website. The program should automatically translate a domain name to an IP address.
  • The outcomes will take some time. Within a few seconds, the program should begin to build results; however, it may take longer to trace the entire path.

How to use Linux to run a traceroute

Many variations of Linux already have traceroute installed, while some editions choose to use tracepath and mtr instead, which are related tools. Anyhow, utilizing the yum (yum install traceroute) or APT (apt-get install traceroute) package managers will typically allow you to download the “classic” traceroute. The following steps are fairly identical to those for Windows after that:

  • Launch the terminal emulator of your choice. If you’re running Linux without a window manager, this step is not necessary (GUI).
  • Enter “traceroute” and the hostname or IP address you want to trace after that.
  • Review the results after the trace is finished.

Conclusion

We appreciate you using this instruction. This should resolve any questions you may have about IP geolocation, we hope.

Share this:

Leave a Comment