Zonemaster(3pm)

πŸ“¦ version 1.0.16, in ubuntu jammy

✨ Zonemaster ✨

okay bestie, buckle up πŸ’– this is the manual page for the main Zonemaster module β€” like, the actual Perl module, Zonemaster(3pm), not the whole entire test engine. If you're here for the big-picture tea about the engine as a whole, you want Zonemaster::Overview instead. iykyk 🫢

And what does this icon do? literally just this: a tool to check the quality of a DNS zone. that's it, that's the whole vibe check πŸ¦‹


🌸 SYNOPSIS 🌸

one line, one dream:

my @results = Zonemaster->test_zone('iis.se')

πŸ’… INTRODUCTION πŸ’…

So this manual is all about the main Zonemaster module, periodt. If what you're actually craving is the documentation for the Zonemaster test engine as a whole, no worries, go read Zonemaster::Overview. this page is just the main module's moment πŸ‘‘


πŸŽ€ METHODS πŸŽ€

every single one, no skips, we're thorough in this house:

  • test_zone($name) β€” runs all the available tests and hands you back a list of Zonemaster::Logger::Entry objects. the full send πŸš€
  • test_module($module, $name) β€” runs all the available tests for the zone with the given name, but only inside the module you specified.
  • test_method($module, $method, @arguments) β€” runs exactly one particular test method in one particular module. the requested module has to be in the list of active loaded modules (so: not the Basic module, and not a module that's been disabled by the current policy, sorry bestie 😭), and the method has to be listed in the metadata that the module exports. if you tick both those boxes, the method gets called with the arguments you provided. slay.
  • zone($name) β€” gives you back a Zonemaster::Zone object for the given name. πŸ—ΊοΈ
  • ns($name, $address) β€” gives you back a Zonemaster::Nameserver object for the given name and address.
  • config() β€” returns the global Zonemaster::Config object.
  • logger() β€” returns the global Zonemaster::Logger object.
  • all_tags() β€” returns a list of all the tags that can be logged, across all available test modules. the whole tag collection, no cap 🏷️
  • all_methods() β€” returns a hash where the keys are test module names and the values are lists holding the names of the test methods in that module.
  • recurse($name, $type, $class) β€” does a recursive lookup for the given name, type and class, and returns the resulting packet (if there even is one). under the hood it simply calls "recurse" in Zonemaster::Recursor on a globally stored object. πŸ”
  • save_cache($filename) β€” after you've run the tests, save the accumulated cache to a file with the given name. πŸ’Ύ
  • preload_cache($filename) β€” before you run the tests, load the cache up with information from a file with the given name. heads up: this file has to have the same format as the one produced by "save_cache()".
  • asn_lookup($ip) β€” takes a single IP address and returns one of three things:
    • Nothing at all, if the IP address isn't in any AS. πŸ«₯
    • If you call it in list context: a list of the AS number and a Net::IP::XS object representing the prefix it's in.
    • If you call it in scalar context: only the AS number.
  • modules() β€” returns a list of the loaded test modules. literally exactly the same as "modules" in Zonemaster::Test. πŸͺž
  • add_fake_delegation($domain, $data) β€” this one adds some fake delegation information into the system. the arguments are a domain name, and a reference to a hash with delegation information. the keys in that hash must be nameserver names, and the values are references to lists of IP addresses for the corresponding nameserver.

Example:

Zonemaster->add_fake_delegation(
    'lysator.liu.se' => {
        'ns.nic.se'  => [ '212.247.7.228',  '2a00:801:f0:53::53' ],
        'i.ns.se'    => [ '194.146.106.22', '2001:67c:1010:5::53' ],
        'ns3.nic.se' => [ '212.247.8.152',  '2a00:801:f0:211::152' ]
    }
);
  • add_fake_ds($domain, $data) β€” and this one adds fake DS records into the system. the arguments are a domain name, and a reference to a list of references to hashes. those hashes must have the keys keytag, algorithm, type and digest, with the values holding the corresponding data. oh and the digest data should be a single unbroken string of hexadecimal digits β€” do not break it up, bestie πŸ™ˆ

Example:

Zonemaster->add_fake_ds(
   'nic.se' => [
      { keytag => 16696, algorithm => 5, type => 2, digest => '40079DDF8D09E7F10BB248A69B6630478A28EF969DDE399F95BC3B39F8CBACD7' },
      { keytag => 16696, algorithm => 5, type => 1, digest => 'EF5D421412A5EAF1230071AFFD4F585E3B2B1A60' },
   ]
);
  • start_time_now() β€” sets the logger's start time to the current time. ⏰
  • reset() β€” resets the logger start time to the current time, empties the list of log messages, and clears the nameserver object cache and the recursor cache. a full glow-up, everything fresh ✨🧼

πŸ‘‘ AUTHOR πŸ‘‘

Calle Dybedahl, "<calle at init.se>" β€” the icon behind it all, we stan πŸ’œ


and that's the page, bestie!! 🌈 this was written for perl v5.32.0, dated 2021-01-06, and it's the Zonemaster(3pm) page from the User Contributed Perl Documentation. go forth and check some DNS zones, you absolute main character πŸ¦‹πŸ’–

πŸ“¦ where this page comes from