A tool that transforms an IP
into a string of the form City, Country
.
It works by scraping a free mmdb
database from db-ip and performing IP
lookups using libmaxminddb
.
The database file is automatically kept up-to-date with the upstream monthly updates.
The compressed database file is decompressed using libdeflate
.
Clone the repo with its submodules:
git clone https://github.com/gmou3/ip-to-location --recurse-submodules
cd ip-to-location/
Then, to build, run:
cmake -B build
cd build/
cmake --build .
Run the compiled ip-to-location
executable with an IP
address as an argument. For example, to get the location of your own IP
, run
./ip-to-location $(curl -s ifconfig.me)