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.