Configuration
Append this line to your ~/.bashrc
file.
iplocation() { curl ipinfo.io/$1; echo; }
Usage
iplocation 172.217.161.227
will print something like this
{
"ip": "172.217.161.227",
"hostname": "kix06s05-in-f3.1e100.net",
"city": "Mountain View",
"region": "California",
"country": "US",
"loc": "37.4192,-122.0570",
"postal": "94043",
"org": "AS15169 Google LLC"
}
The ipinfo.io has times limitation for free usage.