Make sure to replace with the server’s public IP. Once you have got the server public IP address, you can now make a request to ‘s API to fetch the geolocation data using the following command.
Get Linux Server IP Address Get IP Location Data From The API To get the server’s public IP address, use the following curl command to make an API request to ipinfo.io in your terminal as shown.
#HOW TO TRACK IP ADDRESS LOCATION INSTALL#
Install Curl and JQ in Linux Find the Server’s Public IP Address $ sudo apt install curl jq #Ubuntu/Debian To get the IP address geographic location of the server, we need to install curl command line downloader and jq command-line tool to process the JSON data from the geolocation APIs. IP addresses provide an easy way to track the location of the server in the world by using two useful APIs provided by ipinfo.io and to get the city, state, and country connected with a server. On the internet, each server has a public-facing IP address, which is assigned directly to the server or via a router that sends network traffic to that server.
#HOW TO TRACK IP ADDRESS LOCATION HOW TO#
In this article, we will show you how to find the IP address geographic location of a remote Linux system using open APIs and a simple bash script from the command line.