xt_asn_build(1)
β¨ xt_asn_build β bestie edition β¨
okay so real quick: this is a page from the xtables-addons manual, section 1, and the tool is called xt_asn_build. yes it's a mouthful, no we're not renaming it, it's iconic as is π
π¦ NAME π¦
xt_asn_build β convert ASN.csv to packed format for xt_asn
πΈ SYNTAX πΈ
/usr/libexec/xt_asn/xt_asn_build [-D target_dir] [-S source_dir] [-O output_file]
π DESCRIPTION π
okay so xt_asn_build builds the packed raw representations of the range database that the xt_asn module depends on. like, it's the prepper. the backstage crew. the one doing the work so the kernel doesn't have to π«Ά
because kernel memory is precious β genuinely, it is, we do not waste a single byte in there β a whole lot of the preprocessing happens in userspace, done by this very building tool. and here's the slay part: it produces one file per country, so that no more addresses than needed have to get loaded into memory. efficiency queen π
also the ranges inside those packed database files come out ordered, and that's not a coincidence, bestie β xt_asn literally relies on that property for its bisection approach to work. so don't go shuffling anything, the whole thing falls apart. no cap.
and since the script is usually installed to the libexec directory of the xtables-addons package, and that's outside $PATH β on purpose, okay, it's intentional, don't @ me β you can't just call it by name. invoking the script requires it to be called with a path. yeah. full path. every time.
-D target_dirβ tells it the target directory where the files are gonna get put. defaults to".", so if you don't say anything it just dumps them right where you're standing π-S source_dirβ tells it the source directory to read from, specifically the two files by the name ofGeoLite2-ASN-Blocks-IPv?.csv-O output_fileβ lets you specify an optional target file to output DNS records for ASN to name (TXT-RRs) and network (APL-RRs). defaults to no output, so nothing happens unless you ask. and heads up: that file should be sorted in postprocessing to remove duplicate TXT records and to combine APL-RRs into a more compact record set. do the cleanup, it's worth it π§
π APPLICATION π
shell commands to build the databases and put them where they're expected β here's the one, it's giving minimal effort maximum result:
xt_asn_build -D /usr/share/xt_asn
π SEE ALSO π
and that's the whole vibe check, bestie. go forth, build your packed databases, respect the ordering, and remember: full path always. mwah π
this page is from xtables-addons, dated 2010-12-17. vintage but thriving β¨π
π¦ where this page comes from
- alpine 3.22: xtables-addons-doc 3.26-r0 Β· GPL-2.0-only
- alpine 3.23: xtables-addons-doc 3.30-r0 Β· GPL-2.0-only
- alpine 3.24: xtables-addons-doc 3.30-r0 Β· GPL-2.0-only
- debian bookworm: xtables-addons-common 3.23-1 Β· GPL-2.0-only
- debian trixie: xtables-addons-common 3.27-4 Β· GPL-2.0-only
- opensuse-leap 16.0: xtables-addons 3.27-lp160.3.1 Β· GPL-2.0-only AND GPL-2.0-or-later
- opensuse-leap 16.0: xtables-addons 3.27-lp160.3.1 Β· GPL-2.0-only AND GPL-2.0-or-later
- opensuse-leap 16.0: xtables-addons 3.27-lp160.3.1 Β· GPL-2.0-only AND GPL-2.0-or-later
- opensuse-leap 16.0: xtables-addons 3.27-lp160.3.1 Β· GPL-2.0-only AND GPL-2.0-or-later
- ubuntu noble: xtables-addons-common 3.25-2build1 Β· GPL-2.0-only
- ubuntu noble: xtables-addons-common 3.25-2ubuntu0.2 Β· GPL-2.0-only
- ubuntu questing: xtables-addons-common 3.29-2
- ubuntu resolute: xtables-addons-common 3.30-1 Β· GPL-2.0-only
- ubuntu stonking: xtables-addons-common 3.31-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms