How to Detect Which Country an Internet Connection Is Coming From?

December 09, 2020

Have you ever wondered which country an internet connection is coming from We use the internet everyday in our lives and we never wonder, where are these websites that I am connected to located? And yes you could say their physical location. But we all know that internet data doesn’t exists on a location per say but on web servers that are kept in some data center. But you might get curious and ask yourself how can I find out where that website’s location is located. You could say the same thing about game servers, application servers and any other services that uses the internet to connect to a remote location. In this article we are going to find out how we can locate remote internet traffic via some viable methods. But first why would you want to know the location of the incoming connection?

Why Bother Searching For The Location?

With online shops in particular, it can be interesting if you know where the respective website is hosted. Because suppose you are living in germane and if a German online shop is hosted in the Seychelles, the USA or other distant countries from Germany, you should pay particular attention. A closer look at the website usually reveals further problems. However, at this point we would like to be fair to point out that a server location abroad does not automatically cast a bad light on the company. It always depends on the further circumstances. The server location is often used as an indication of inconsistencies in the detection of fake shops. Viewed in isolation, however, the server location does not allow any conclusions to be drawn as to whether the site is serious or dubious. By locating the IP address, you can, with a little practice, find out, for example, from where an email was sent and whether the determined location matches the specified email address of the sender. An example: If the sender is an email address with the ending @ gov.uk or @ t-online.uk, then the IP address of the sender should not be located in Taiwan or Turkey. In this case, something would be wrong, so that a fake can be assumed. Now that we know why we would want to know the location let’s find out how internet data is bounced around?

How The Internet Functions Across The World

How The Internet Functions Across The World

To know where the internet traffic is coming from, first you must understand how the internet functions. If you have a basic understanding of Routing and how the internet works, you can skip ahead to the next section. If not stick around to find out how the internet operates. The internet is a network computer that is scaled up, meaning it functions on the same TCI/IP layers that a WAN might use but the infrastructure is different. So basically to know the location of a client on a computer, you always have to look at the IP address of that client. An IP address is a unique identifier in networks that is assigned to the devices. Computers can only be reached through the IP address and data can be exchanged between devices. IP addresses are used both on the Internet and in local networks. Therefore, almost every computer can be reached via several IP addresses, such as a public IP address and an internal IP address of the local network. In addition, several computers or other devices such as smartphones can be reached via one IP address. This is the same for internet IP addresses, as you might already know, IP addresses on the internet are limited to a certain degree and it’s assigned dynamically by the ISP you are getting your internet connection from. So in order to find out where an internet connection originates you will have to find it’s public IP address and then try and find where that IP is located.

Location Location Location

This is very important if you have CDN (Dynamic IP) or hosted applications at the provider's location with multiple nating and floating IP addresses. There are many ways to find this information, but getting it quickly and accurately will make you smarter. In this section I am going to post online tools to help find 1) DNS IP address 2) IP locations.

Find out where DNS resolves to

Let's take a scenario where you've found a URL that won't connect to your application and need to find out the URL's IP address. If it's an internal url, then you can easily nslookup and find out the ip address. Example: nslookup internalurl.intra However, if it is an external url and it cannot be nslookupbecause your network administrator is blocking it, you will need to use online tools to find out. Here are two DNS record lookup tools that you can use to locate a DNS record.

DNS monitoring

DNS monitoring

DNSWatch is my first choice to find out how to resolve IP and NS records. You can also use this tool to find AAA, MX, NS, SOA, and TXT records. It's very easy to use - access the following url, enter the url you want to find out, and hit resolve. And you can see the results, it is resolved into two name servers and two IP addresses.

Find out the IP location, ISP

This scenario can be very far reaching, some of the following. • Your application will be speeded up with CDN like AKAMAI etc which will be resolved based on location and you need to get specific IP location • You see unusual request patterns in your application and want to know the IP location and its owner • You want to own a specific IP address There are many tools that can help you with this. However, here are is an online tool that I use that I found very useful.

IP location

It is my first choice of IP location to find out the IP location and its property. To use, access the following url >> enter an IP address and click query As a result, you can view geolocation data from IP2Location, IPLigence, IP Address Labs, DB-IP, IPINFO.IO and MaxMind. You will see in a query that you are getting results from different geolocation databases. Isn't it cool to have this information in seconds and it's free!