A handy utility by Rafael Rinaldi called whereami allows you to geolocate an IP address directly from the command line. Here are some quick notes on installing and using this tool.

I am using Ubuntu 18.04.5 LTS running under WSL2 so there were some pre-requisites I had to install: nvm, node.js, and npm. Here’s how to do this on Ubuntu:

Installing the whereami utility is easy:

And here’s an example of how to use it with dig: