How to get the geographical location of an IP address.

Posted: March 18, 2014. At: 11:01 AM. This was 4 years ago. Post ID: 7075
Page permalink.
WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters. These cookies expire two weeks after they are set.

How to get the geographical location of an IP address. This simple command will get this for you.

[jason@darknet:~] curl ipinfo.io/203.113.124.148 ; echo ""
{
  "ip": "203.113.124.148",
  "hostname": "No Hostname",
  "city": "",
  "region": "",
  "country": "TH",
  "loc": "13.7500,100.4667",
  "org": "AS9737 TOT Public Company Limited"
}

In this example, I am getting information about Google`s DNS IP.

[jason@darknet:~] curl ipinfo.io/8.8.8.8 ; echo ""
{
  "ip": "8.8.8.8",
  "hostname": "google-public-dns-a.google.com",
  "city": "Mountain View",
  "region": "California",
  "country": "US",
  "loc": "37.3845,-122.0881",
  "org": "AS15169 Google Inc.",
  "postal": "94040"
}

This command will get information about an IP address from the ipinfo.io website. This is a useful way to get information about your own IP address, or an IP address from a logfile.

No comments have been made. Use this form to start the conversation :)

Leave a Reply