validns(1)
π NAME π
validns β the DNS and DSNSEC zone file validator, your new bestie for making sure your zone isn't a whole mess π
Okay so real talk, bestie, this page describes validns version 0.11.0. Slay.
β¨ SYNOPSIS β¨
validns -h validns [options] zone-file
And listen, if you wanna validate stuff coming in on stdin? Just drop a "-" where zone-file would go. Iconic behaviour honestly. π«Ά
πΈ DESCRIPTION πΈ
So validns reads a DNS zone in the master file format of RFC 1035 section 5.1 and checks whether it's actually correct. It parses every single record and every directive, and when it can't parse something it tells you the exact reason why β no vague "something went wrong" energy here, we don't do that. Then it runs a whole stack of structural, consistency, and (for signed zones) DNSSEC checks over everything it parsed. π
For a DNSSEC-signed zone, validns:
- verifies each
RRSIGagainst the correspondingDNSKEY - checks that signatures are within their validity period
- walks the
NSECorNSEC3authenticated-denial chain to confirm it's complete and consistent with the records actually present in the zone
The basic checks and the DNSSEC checks are always performed. The extra operator policy checks? Those are opt-in, one at a time, with -p (peep POLICY CHECKS below, bestie).
The intended use is validating a zone before you publish it β like as a step in a zone-signing or provisioning pipeline. Main character energy: catch the problem at home, not in production. π
By default validns processes the whole zone and reports every problem it finds. -f makes it stop at the first error instead. And it exits with a non-zero status if any errors were reported, and zero otherwise. So you can trust the exit code, fr fr.
π¦ ZONE FILE FORMAT π¦
Format of zone files follows that of RFC 1035 section 5.1, with one exception: "\.", aka dots in labels, are not supported, due to how domain names are stored internally. Not us being lazy, just how the internals vibe. π
Additionally:
$TTLis supported as described in RFC 2308$GENERATEis partly supported
π OPTIONS π
-hβ Produce usage text and quit. Little help me out moment. π₯Ί-fβ Quit on first validation error. Normally,validnscontinues working on a zone after encountering a parsing or validation error, but with this it's one strike and we're out.-p nameβ Activate policy check name. By default only basic checks and DNSSEC checks are performed. You can specify this option multiple times (stack 'em, bestie). See POLICY CHECKS below for the deets.-n Nβ Use N worker threads for parallelizable operations. The default is0, meaning no parallelization. Currently only signature verification is parallelizable. More threads, more speed, iykyk. π₯-qβ quiet β do not produce any output.-sβ Print validation summary/stats. If specified twice, also print record counts by type. Double it and it gives you more. β¨-vβ be extra verbose. Tell me everything, king. π-Lβ List all record typesvalidnscan render, one per line, and exit.-Mβ use SOA MINTTL as the default TTL when no TTL specified.-I pathβ use this path for$INCLUDEfiles.-z originβ use this origin as initial$ORIGIN.-t epoch-timeβ Use specified time instead of the current time when verifying validity of the signatures. This option may be specified multiple times, in which case every signature is checked against all specified times. Time travel but make it validational. β-Vβ Print version and exit.
π BASIC CHECKS π
Every record and every supported directive should be parsable β that's the most basic check of all. And the validns program will report the exact reason why it cannot parse a record or a directive. No cryptic nonsense. π
Other basic checks include:
- there could only be one
SOAin a zone; - the first record in the zone must be an
SOArecord; - a record outside the apex;
- TTL values differ within an RR set (excepting
RRSIG);
π₯ DNSSEC CHECKS π₯
- type exists, but
NSECdoes not mention it for name; NSECmentions type, but no such record found for name;NSECsays x is the last name, but z exists;NSECsays z comes after x, but nothing does;NSECsays z comes after x, but y does;- signature is too new;
- signature is too old;
RRSIGexists for non-existing type type;RRSIG's original TTL differs from corresponding record's;RRSIG(type): cannot find a signer key;RRSIG(type): cannot verify the signature;RRSIG(type): cannot find the right signer key;NSEC3record name is not valid;- multiple
NSEC3with the same record name; - no corresponding
NSEC3found for name; - type exists, but
NSEC3does not mention it for name; NSEC3mentions type, but no such record found for name;- there are more record types than
NSEC3mentions for name; - broken
NSEC3chain, expected name, but nothing found; - broken
NSEC3chain, expected name1, but found name2; NSEC3without a corresponding record (or empty non-terminal);- name type: no covering
RRSIGin a signed zone; - algorithm signatures cannot be validated: digest is disabled by system crypto policy.
On systems where cryptographic algorithms are restricted by policy (e.g., RHEL 9/CentOS 9 with SHA-1 disabled), validns detects this and reports which algorithms cannot be validated. Affected signatures are skipped rather than producing cryptic errors. We're being nice about it π«Ά
π POLICY CHECKS π
The following policy checks are understood:
single-nsβ Checks that there are at least twoNSrecords per name (or zero).cname-other-dataβ Checks for CNAME and other data condition (excluding possible andNSEC).dnameβDNAMEchecks: no multipleDNAMEs, no descendants of a node with aDNAME. Please note thatDNAME/CNAMEclash is handled by CNAME and other data check already.dnskeyβDNSKEYchecks: public key too short, leading zero octets in public key exponent or modulus.nsec3param-not-apexβNSEC3PARAM, if present, should only be at the zone apex.mx-aliasβMXexchange should not be an alias.ns-aliasβNSnsdname should not be an alias.rp-txt-existsβTXTdomain name mentioned inRPrecord must have a correspondingTXTrecord if it is within the zone.tlsa-hostβ Domain name of aTLSArecord must be a proper prefixed DNS name.ksk-existsβ AKSKkey must exist in a signed zone.smimea-hostβ Domain name must have the form which is proper for anSMIMEArecord.all-algorithms-signedβ In a signed zone, every RR set that must be signed must have coveringRRSIGrecords for every algorithm present in the apexDNSKEYRR set (RFC 4035, section 2.2).occluded-recordsβ Records hidden below a zone cut (occluded by a delegation) are reported. Address records serving as glue are exempt: those referenced from theNSRR set of the delegation above them, or from the apexNSRR set. Glue referenced only by some other delegation ("sibling glue") is still reported; combine withno-strict-glueto permit it.missing-glueβ Every delegation whose name server names fall at or below the delegation point must haveAorAAAAglue records for them.allβ Activates all of the above policy checks (but not the ones described below).permit-starting-hyphenβ Starting hyphen (normally disallowed) is permitted in names.no-strict-glueβ Modifiesoccluded-recordsto also accept glue referenced by anyNSrecord in the zone, not just the delegation the glue sits under or the apexNSRR set.
π BUGS π
- textual segments in
TXTandHINFOmust be enclosed in double quotes;
If at least one NSEC3 record uses opt-out flag, validns assumes it is used as much as possible, that is, every unsigned delegation does not have a corresponding NSEC3 record. This is done for reasons of efficiency, to avoid calculating cryptographic hashes of every unsigned delegation. If this assumption is wrong for a zone, validns will produce spurious validation errors. π
Not gonna lie, that last one is important β if that assumption doesn't hold for your zone, you'll get errors that aren't really errors, and you'll be sitting there like π
π§ ACKNOWLEDGEMENTS π§
Thanks go to Andy Holdaway, Daniel Stirnimann, Dennis Kjaer Jensen, Goran Bengtson, Hirohisa Yamaguchi, Hugo Salgado, Jake Zack, Jakob Schlyter, Koh-ichi Ito, Mathieu Arnold, Miek Gieben, Patrik Wallstrom, Paul Wouters, Ryan Eby, Tony Finch, Willem Toorop, and YAMAGUCHI Takanori for bug reports, testing, discussions, and occasional patches. Absolute legends, every one of them. π«Άβ¨
Special thanks to Stephane Bortzmeyer and Phil Regnauld.
Thanks for AFNIC which funded major portion of the development. Thanks for SWITCH for additional funding. π
And that's the whole vibe, bestie β this was validns 0.11.0, documented as a General Commands Manual, printed under validns(1). Now go validate that zone before you publish it. Periodt. π
πΈ
π¦ where this page comes from
- ubuntu stonking: validns 8.0+really0.11.0-1build1 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms