GEOLOOKUP(1)

πŸ“¦
version 1.7.10 Β· 2 versions
, in epel 10

πŸ’… GEOLOOKUP πŸ’…

okay bestie, so this is geolookup from the General Commands Manual β€” literally the little tool that tells you where an IP is from and which AS owns it. buckle up πŸŽ€


✨ NAME ✨

geolookup β€” geo location lookup for IP addresses 🌍


πŸ¦‹ SYNOPSIS πŸ¦‹

geolookup [-G geoDBfile] [-h] iplist
geolookup -d directory -w geoDBfile

like, two whole modes. one is look stuff up, the other is build the database. both iconic πŸ’…


🌸 DESCRIPTION 🌸

okay so geolookup is the tool that looks up AS and geo location info for one or more IP addresses. but before you can use it, you have to create the nfdump specific lookup database first. no database, no vibes. 😭

geolookup is also the thing that builds the nfdump formatted lookup database file out of the maxmind csv files. for that you need a maxmind account over at https://maxmind.com so you can download the relevant csv file. the building instructions are in the section below, don't worry 🫢

here's the cute part: geolookup accepts a list of IP addresses either on the command line, separated by spaces, or on stdin line by line. and the IP on each line can be embedded in a string with spaces on the left and right β€” so it can literally read the piped output from other tools. main character energy fr fr πŸ‘‘

geolookup also accepts a list of AS numbers prefixed with as and separated with spaces ✨

the options are as follows:

  • -d directory β€” use the csv files in directory to build the binary lookup database file. with this argument geolookup creates a new binary lookup database file. πŸ—οΈ
  • -w geoDBfile β€” name of the new lookup database file.
  • -G geoDBfile β€” use the binary geoDBfile as the lookup database for the current AS and location lookups.
  • -h β€” print help and exit. that's it, that's the whole flag πŸŽ€

so to specify the geo lookup database, geolookup searches at the following places:

  • if the default nfdump(1) configuration file exists, it reads the tag geodb.path
  • if the environment variable NFGEODB is set, use this setting as lookup database
  • the command line argument -G

and if multiple locations are given, here's the priority, lowkey a whole hierarchy bestie:

the environment variable NFGEODB overwrites the nfdump config file, and the command line option -G overwrites the environment variable NFGEODB. πŸ‘‘

πŸ’œ ENVIRONMENT πŸ’œ

geolookup reads the environment variable NFGEODB πŸ’–


⭐ EXIT STATUS ⭐

geolookup returns 0 on success and 255 otherwise. so like, zero is the slay, 255 is the not-slay πŸ’€


πŸ”₯ EXAMPLES πŸ”₯

okay so to create a lookup database, you need an account at https://maxmind.com. it works with the paid GeoDB as well as with the free GeoLite2 csv files β€” so there's a free path, we love that for us 🌈

the easiest way for creating or updating the binary lookup database is the use of the script updateGeoDB.sh provided with all other nfdump files. insert your license key and run the script. this creates a new lookup database. easy. ✨

if you want to do it manually, follow these steps:

  1. log into https://maxmind.com and download the corresponding csv files: GeoLite2-ASN-CSV and GeoLite2-City-CSV
  2. unpack the zip files and put the following csv files into a newly created build directory: GeoLite2-ASN-Blocks-IPv4.csv, GeoLite2-ASN-Blocks-IPv6.csv, GeoLite2-City-Blocks-IPv4.csv, GeoLite2-City-Blocks-IPv6.csv, GeoLite2-City-Locations-en.csv. Maxmind offers several languages for the City-Locations file β€” choose only one. 🚨 only one, bestie, don't be greedy πŸ™ˆ
  3. geolookup -d builddir -w geofile
  4. move the lookup database to the final location. you're done, go brunch πŸ₯‚

🧚 SEE ALSO 🧚

nfdump has already builtin lookup options to decorate the text output with geo location and AS information. so like, iykyk. πŸ‘‘

nfdump(1)


ngl that's the whole page. go forth and geolocate, queen 🫢

this page came from Debian, version $Mdocdate$ β€” mwah, enjoy the read, bestie πŸ’…πŸ’–

πŸ“¦ where this page comes from
  • epel 10: nfdump 1.7.10-1.el10_3 Β· BSD-3-Clause AND GPL-2.0-or-later
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms