xt_geoip_query(1)

πŸ“¦
version 3.31 Β· 2 versions
  • 3.31 Β· alpine 3.22, alpine 3.23, alpine 3.24, debian trixie, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 3.23 Β· debian bookworm, ubuntu jammy
, in alpine 3.22, alpine 3.23, alpine 3.24, debian trixie, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– xt_geoip_query β€” dump a country database to stdout πŸ’–

okay bestie, so this one lives in the xtables-addons manual set, section 1 (that's user commands, iykyk). it's called xt_geoip_query and honestly? it's giving "let me just show you the goods". πŸŽ€


✨ SYNTAX ✨

xt_geoip_query [-D database_dir] [-4] [-6] cc [ cc ... ]

no cap, that's the whole shape of it. flags first, then one or more country codes. periodt. πŸ’…


🌸 DESCRIPTION 🌸

so what does it actually do? xt_geoip_query reads a country's IPv4 or IPv6 databases and dumps them straight to standard output as a sorted, non-overlapping list of ranges β€” which, fun fact, is exactly how they're represented in the database in the first place. so it's not doing any fancy remixing, it's just showing you the truth. πŸ¦‹

and it's perfect for browsing, or for feeding into further processing. main character energy for your shell pipelines. ✨

  • -D database_dir β€” tells it which directory the files have been put into. defaults to . (yes, literally just the current dir, she's low maintenance).
  • -4 β€” IPv4 data only, bestie. πŸ“
  • -6 β€” IPv6 data only. 🌈
  • cc [ cc ... ] β€” the ISO 3166 country code names of the desired countries' databases. so like ch, us, de… you can pass more than one, go off. πŸ‘‘
ngl the vibes here are extremely "read-only, harmless, safe to run". it dumps, it doesn't touch. πŸ’–

πŸŽ€ APPLICATION πŸŽ€

here's the shell command to dump the list of Swiss IPv6 address ranges β€” a certified classic:

xt_geoip_query -D /usr/share/xt_geoip -6 ch

see how it all comes together? -D for where, -6 for the v6 girlies, ch for Switzerland. ate. πŸ”₯


πŸ‘€ SEE ALSO πŸ‘€

  • xt_geoip_build(1) β€” the one that makes the databases in the first place. the prequel. 🧚

and that's the whole page, bestie!! 🫢 this little cutie comes from xtables-addons, dated 2020-04-30, and it is genuinely, unironically iconic. go dump some ranges. slay. πŸ’œβœ¨