Zonema...erview(3pm)
π Zonemaster::Overview β The Zonemaster Test Engine π
okay bestie, pull up a chair, we're reading Zonemaster::Overview(3pm) together and it's genuinely such a serve. this is the tea on the Zonemaster test engine, the whole thing, no gatekeeping. π«Ά
β¨ INTRODUCTION β¨
so the Zonemaster system is a quality control tool for DNS zones, and it's a collab between AFNIC and IIS β those are the top-level registries for France and Sweden respectively, iconic duo behavior fr fr. it's the successor to both AFNIC's tool Zonecheck and IIS's tool DNSCheck, and the whole point is that it's meant to be an improvement over both. glow up achieved. π
the system as a whole is the test engine plus, as distributed by the project, two different front ends:
- one is a command-line interface, intended for use by experienced technicians (that's the iykyk crowd)
- one is a web interface, meant for use by anyone (yes literally anyone, main character energy for the general public)
and this document? it only talks about the test engine. just the engine. nothing else. periodt. π
πΈ DESCRIPTION πΈ
π¦ Brief overview π¦
conceptually, the test engine is a bunch of test implementation modules surrounded by a support framework. that's the whole vibe. anyone who wants to use Zonemaster to actually perform tests talks to the framework from the "outside", and all the modules implementing tests see the world entirely through the framework. no peeking behind the curtain bestie.
and the way we do things here buys us some genuinely great features:
- the ability to test domains before they are published β¨
- the ability to record entire test runs for later analysis πΌ
- and making sure that test results are β as far as reality allows β predictable and repeatable π
π For users of Zonemaster π
okay so if all you wanna do is run tests, you only need to care about like four or five modules. not bad!
Zonemasteris the main access point to the framework, and it's via its methods that you set the configuration (if needed), request that tests be started, and access the logger.- the logger is where the test results end up, so that's pretty important, obviously.
- on top of those, you may want
Zonemaster::Translatorto turn the results into human-readable messages. π«Ά
and here's the thing β there are two ways you can get the results of a test you've requested:
- the simple-but-inflexible way
- the flexible-but-complex way
π the simple-but-inflexible way π
so every method in Zonemaster that runs tests returns lists of Zonemaster::Logger::Entry objects. those lists include all the results that the writer of the test module(s) considered important enough to return by default. the advantage? it is extremely easy to use. and here's a functional (if not very useful) way to run a full test and print the results right from a command line prompt:
perl -MZonemaster -E 'say "$_" for Zonemaster->new->test_zone("example.org")'
the main drawbacks though π:
- there's no choice about what messages to see
- it's entirely asynchronous β the code that started the test does not get a chance to do anything at all until the whole test has finished, which may be several minutes later
π§ the flexible-but-complex way π§
to get around those drawbacks, there's the flexible-but-complex way, which consists of installing a callback that gets executed every time a message is logged. and ngl, code-wise it's not that much more complicated. here's an example that does roughly the same thing as the one above:
perl -MZonemaster -E 'Zonemaster->logger->callback(sub {say "$_[0]"}); Zonemaster->new->test_zone("example.org");'
if you try running those, you'll notice two main differences:
- the second variant prints results as they are generated β¨
- it generates a lot more output
and on the author's machine right now, the first example gives 94 lines of output, while the second example gives 17684. yes. seventeen thousand. π
you can do pretty much whatever you want with the message objects in the callback (including modifying them, although we don't promise that behavior will stay around, so don't get too attached π).
β οΈ if the callback code throws an exception, and that exception is not a subclass of Zonemaster::Exception, the callback will be removed. gone. bye. π
β οΈ also note: while the callback is running, the test engine itself is not. so think twice before you do potentially time-consuming tasks (like sticking the message in a database) in the callback, bestie. after waiting for responses from remote name servers (which usually stands for more than 90% of the time used), result logging is the single most time-consuming task in a Zonemaster test run.
from here, you probably want to look at the documentation for:
ZonemasterZonemaster::LoggerZonemaster::Logger::EntryZonemaster::ConfigZonemaster::Translator
π For developers of Zonemaster Test Modules π
if you want to develop a test module of your own, the Zonemaster::Test::Example module is intended to serve as an example. and the standard set of modules also fulfils that purpose to various degrees, of course. but here's the one that's especially interesting β Zonemaster::Test::DNSSEC β because it is an example of including default translation and policy data with the module source code. obsessed tbh.
as an entry point to the "inside" of the Zonemaster framework, you want to read Zonemaster::Zone and follow references from there. and after the zone class, the ones of particular interest are:
Zonemaster::Nameserver- and possibly
Zonemaster::Recursor
and then, a personal note from the author: if you do write your own test module, they would very much appreciate feedback on which parts were tricky to figure out, because honestly they're not sure what needs to be explained here. so please, if there's something that you think really needs to be written about, add an issue about it at:
https://github.com/dotse/zonemaster-engine/issues
π For developers of the Zonemaster Test Framework π
random recommendations and advice, bestie. and note β this may be replaced with more coherent developer documentation in the future, so enjoy the chaos while it lasts. π
- Stability, predictability and reliability are more important than performance. say it louder for the people in the back.
- don't forget that starting with Perl version 5.18, the order in which you get the keys out of a hash will be different every time the script is run. get used to always writing
sort keys %hash. no cap, just do it. - if two (or more) test implementation modules implement the same (or very similar) thing, it should probably be extracted into the framework.
- the unit tests run against pre-recorded data, unless the environment variable
ZONEMASTER_RECORDis set to a (perl-)true value. in that case, it runs against the live DNS world and records all results for future use. unfortunately this sometimes means that some tests fail, when we were relying on seeing certain problems in certain domains, and those no longer look the same. π - the translation strings returned from a test module are used as keys in the GNU gettext system, so if you change anything in them don't forget to also change the translation
.pofiles inshare. - adding a new message tag is more work than it first looks, since it needs to be added to the test module metadata, the default policy and the translation system in order to be fully functional. it's giving β¨three places at onceβ¨.
π REFERENCES
- <https://github.com/dotse/zonemaster> β bestie this is the main repository, and it's holding, among other things, our test specifications. like it's the mothership okurrr β¨
π List of all RFCs referred to in the test specifications
okay so this is the reading list and honestly? it's giving β¨syllabusβ¨. every single one of these is cited somewhere in the test specs, so here they all are, no skips, no skimming, we are completing the assignment π
RFC0822"STANDARD FOR THE FORMAT OF ARPA INTERNET TEXT MESSAGES" <http://www.rfc-editor.org/info/rfc822>RFC0919"Broadcasting Internet Datagrams" <http://www.rfc-editor.org/info/rfc919>RFC0952"DoD Internet host table specification" <http://www.rfc-editor.org/info/rfc952>RFC1033"Domain Administrators Operations Guide" <http://www.rfc-editor.org/info/rfc1033>RFC1034"Domain names - concepts and facilities" <http://www.rfc-editor.org/info/rfc1034>RFC1035"Domain names - implementation and specification" <http://www.rfc-editor.org/info/rfc1035>RFC1112"Host extensions for IP multicasting" <http://www.rfc-editor.org/info/rfc1112>RFC1122"Requirements for Internet Hosts - Communication Layers" <http://www.rfc-editor.org/info/rfc1122>RFC1123"Requirements for Internet Hosts - Application and Support" <http://www.rfc-editor.org/info/rfc1123>RFC1912"Common DNS Operational and Configuration Errors" <http://www.rfc-editor.org/info/rfc1912>RFC1918"Address Allocation for Private Internets" <http://www.rfc-editor.org/info/rfc1918>RFC1930"Guidelines for creation, selection, and registration of an Autonomous System (AS)" <http://www.rfc-editor.org/info/rfc1930>RFC1982"Serial Number Arithmetic" <http://www.rfc-editor.org/info/rfc1982>RFC1996"A Mechanism for Prompt Notification of Zone Changes (DNS NOTIFY)" <http://www.rfc-editor.org/info/rfc1996>RFC2142"Mailbox Names for Common Services, Roles and Functions" <http://www.rfc-editor.org/info/rfc2142>RFC2181"Clarifications to the DNS Specification" <http://www.rfc-editor.org/info/rfc2181>RFC2182"Selection and Operation of Secondary DNS Servers" <http://www.rfc-editor.org/info/rfc2182>RFC2308"Negative Caching of DNS Queries (DNS NCACHE)" <http://www.rfc-editor.org/info/rfc2308>RFC2544"Benchmarking Methodology for Network Interconnect Devices" <http://www.rfc-editor.org/info/rfc2544>RFC2671"Extension Mechanisms for DNS (EDNS0)" <http://www.rfc-editor.org/info/rfc2671>RFC2822"Internet Message Format" <http://www.rfc-editor.org/info/rfc2822>RFC2870"Root Name Server Operational Requirements" <http://www.rfc-editor.org/info/rfc2870>RFC2928"Initial IPv6 Sub-TLA ID Assignments" <http://www.rfc-editor.org/info/rfc2928>RFC3056"Connection of IPv6 Domains via IPv4 Clouds" <http://www.rfc-editor.org/info/rfc3056>RFC3068"An Anycast Prefix for 6to4 Relay Routers" <http://www.rfc-editor.org/info/rfc3068>RFC3658"Delegation Signer (DS) Resource Record (RR)" <http://www.rfc-editor.org/info/rfc3658>RFC3696"Application Techniques for Checking and Transformation of Names" <http://www.rfc-editor.org/info/rfc3696>RFC3701"6bone (IPv6 Testing Address Allocation) Phaseout" <http://www.rfc-editor.org/info/rfc3701>RFC3849"IPv6 Address Prefix Reserved for Documentation" <http://www.rfc-editor.org/info/rfc3849>RFC3927"Dynamic Configuration of IPv4 Link-Local Addresses" <http://www.rfc-editor.org/info/rfc3927>RFC4034"Resource Records for the DNS Security Extensions" <http://www.rfc-editor.org/info/rfc4034>RFC4035"Protocol Modifications for the DNS Security Extensions" <http://www.rfc-editor.org/info/rfc4035>RFC4074"Common Misbehavior Against DNS Queries for IPv6 Addresses" <http://www.rfc-editor.org/info/rfc4074>RFC4193"Unique Local IPv6 Unicast Addresses" <http://www.rfc-editor.org/info/rfc4193>RFC4291"IP Version 6 Addressing Architecture" <http://www.rfc-editor.org/info/rfc4291>RFC4343"Domain Name System (DNS) Case Insensitivity Clarification" <http://www.rfc-editor.org/info/rfc4343>RFC4380"Teredo: Tunneling IPv6 over UDP through Network Address Translations (NATs)" <http://www.rfc-editor.org/info/rfc4380>RFC4843"An IPv6 Prefix for Overlay Routable Cryptographic Hash Identifiers (ORCHID)" <http://www.rfc-editor.org/info/rfc4843>RFC5155"DNS Security (DNSSEC) Hashed Authenticated Denial of Existence" <http://www.rfc-editor.org/info/rfc5155>RFC5156"Special-Use IPv6 Addresses" <http://www.rfc-editor.org/info/rfc5156>RFC5180"IPv6 Benchmarking Methodology for Network Interconnect Devices" <http://www.rfc-editor.org/info/rfc5180>RFC5321"Simple Mail Transfer Protocol" <http://www.rfc-editor.org/info/rfc5321>RFC5358"Preventing Use of Recursive Nameservers in Reflector Attacks" <http://www.rfc-editor.org/info/rfc5358>RFC5737"IPv4 Address Blocks Reserved for Documentation" <http://www.rfc-editor.org/info/rfc5737>RFC5771"IANA Guidelines for IPv4 Multicast Address Assignments" <http://www.rfc-editor.org/info/rfc5771>RFC5892"The Unicode Code Points and Internationalized Domain Names for Applications (IDNA)" <http://www.rfc-editor.org/info/rfc5892>RFC5936"DNS Zone Transfer Protocol (AXFR)" <http://www.rfc-editor.org/info/rfc5936>RFC6052"IPv6 Addressing of IPv4/IPv6 Translators" <http://www.rfc-editor.org/info/rfc6052>RFC6333"Dual-Stack Lite Broadband Deployments Following IPv4 Exhaustion" <http://www.rfc-editor.org/info/rfc6333>RFC6598"IANA-Reserved IPv4 Prefix for Shared Address Space" <http://www.rfc-editor.org/info/rfc6598>RFC6666"A Discard Prefix for IPv6" <http://www.rfc-editor.org/info/rfc6666>RFC6781"DNSSEC Operational Practices, Version 2" <http://www.rfc-editor.org/info/rfc6781>RFC6890"Special-Purpose IP Address Registries" <http://www.rfc-editor.org/info/rfc6890>RFC6891"Extension Mechanisms for DNS (EDNS(0))" <http://www.rfc-editor.org/info/rfc6891>RFC7050"Discovery of the IPv6 Prefix Used for IPv6 Address Synthesis" <http://www.rfc-editor.org/info/rfc7050>
and that's the whole list bestie, all 55 of them, we ate and left no crumbs π go read them at your own pace, hydrate, take breaks, the RFCs aren't going anywhere π
this page was brought to you by perl v5.32.0, dated 2021-01-06, and it's the Zonema...erview(3pm) one β thanks for reading all the way to the bottom, you're literally the main character π«Άβ¨π
π¦ where this page comes from
- ubuntu jammy: libzonemaster-perl 1.0.16-2.1 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms