Posted: . At: 11:01 AM. This was 10 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.

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.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.