.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Zonemaster::Engine 3pm" .TH Zonemaster::Engine 3pm 2024-04-22 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Zonemaster::Engine \- A tool to check the quality of a DNS zone .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& my @results = Zonemaster::Engine\->test_zone(\*(Aqiis.se\*(Aq) .Ve .SH INTRODUCTION .IX Header "INTRODUCTION" This manual describes the main Zonemaster::Engine module. If what you're after is documentation on the Zonemaster test engine as a whole, see Zonemaster::Engine::Overview. .SH METHODS .IX Header "METHODS" .IP \fBinit_engine()\fR 4 .IX Item "init_engine()" Run the inititalization tasks if they have not been run already. This method is called automatically in INIT block. .IP test_zone($name) 4 .IX Item "test_zone($name)" Runs all available tests and returns a list of Zonemaster::Engine::Logger::Entry objects. .ie n .IP "test_module($module, $name)" 4 .el .IP "test_module($module, \f(CW$name\fR)" 4 .IX Item "test_module($module, $name)" Runs all available tests for the zone with the given name in the specified module. .ie n .IP "test_method($module, $method, $name)" 4 .el .IP "test_method($module, \f(CW$method\fR, \f(CW$name\fR)" 4 .IX Item "test_method($module, $method, $name)" Run one particular test method in one particular module for one particular zone. The requested module must be in the list of active loaded modules (that is, not the Basic module and not a module disabled by the current profile), and the method must be listed in the metadata the module exports. If those requirements are fulfilled, the method will be called with the provided arguments. .IP zone($name) 4 .IX Item "zone($name)" Returns a Zonemaster::Engine::Zone object for the given name. .ie n .IP "ns($name, $address)" 4 .el .IP "ns($name, \f(CW$address\fR)" 4 .IX Item "ns($name, $address)" Returns a Zonemaster::Engine::Nameserver object for the given name and address. .IP \fBprofile()\fR 4 .IX Item "profile()" Returns the effective profile (Zonemaster::Engine::Profile object). .IP \fBlogger()\fR 4 .IX Item "logger()" Returns the global Zonemaster::Engine::Logger object. .IP \fBall_tags()\fR 4 .IX Item "all_tags()" Returns a list of all the tags that can be logged for all available test modules. .IP \fBall_methods()\fR 4 .IX Item "all_methods()" Returns a hash, where the keys are test module names and the values are lists with the names of the test methods in that module. .ie n .IP "recurse($name, $type, $class)" 4 .el .IP "recurse($name, \f(CW$type\fR, \f(CW$class\fR)" 4 .IX Item "recurse($name, $type, $class)" Does a recursive lookup for the given name, type and class, and returns the resulting packet (if any). Simply calls "recurse" in Zonemaster::Engine::Recursor on a globally stored object. .IP \fBcan_continue()\fR 4 .IX Item "can_continue()" In case of critical condition that prevents tool to process tests, add test here and return False. .IP save_cache($filename) 4 .IX Item "save_cache($filename)" After running the tests, save the accumulated cache to a file with the given name. .IP preload_cache($filename) 4 .IX Item "preload_cache($filename)" Before running the tests, load the cache with information from a file with the given name. This file must have the same format as is produced by "\fBsave_cache()\fR". .IP asn_lookup($ip) 4 .IX Item "asn_lookup($ip)" Takes a single IP address (string or Net::IP::XS object) and returns a list of AS numbers, if any. .IP \fBmodules()\fR 4 .IX Item "modules()" Returns a list of the loaded test modules. Exactly the same as "modules" in Zonemaster::Engine::Test. .ie n .IP "add_fake_delegation($domain, $data, %flags)" 4 .el .IP "add_fake_delegation($domain, \f(CW$data\fR, \f(CW%flags\fR)" 4 .IX Item "add_fake_delegation($domain, $data, %flags)" This method adds some fake delegation information to the system. .Sp The arguments are a domain name, and a hashref with delegation information. The keys in the hash are nameserver names, and the values are arrayrefs of IP addresses for their corresponding nameserver. Alternatively the IP addresses may be specified as an `undef` which is handled the same as an empty arrayref. .Sp For each provided nameserver with an empty list of addresses, either a \&\f(CW\*(C`FAKE_DELEGATION_NO_IP\*(C'\fR or a \f(CW\*(C`FAKE_DELEGATION_IN_ZONE_NO_IP\*(C'\fR message is emitted. .Sp The only recognized flag is \f(CW\*(C`fill_in_empty_oob_glue\*(C'\fR. This flag is boolean and defaults to true. If this flag is true, this method updates the given \f(CW$data\fR by looking up and filling in some glue addresses. Specifically the glue addresses for any nameserver name that are out-of-bailiwick of the given \f(CW$domain\fR and that comes with an empty list of addresses. .Sp Returns `1` if all name servers in \f(CW$data\fR have non-empty lists of glue (after they've been filled in) or if `fill_in_empty_oob_glue` is false. Otherwise it returns `undef`. .Sp Examples: .Sp .Vb 8 \& Zonemaster::Engine\->add_fake_delegation( \& \*(Aqlysator.liu.se\*(Aq => { \& \*(Aqns1.nic.fr\*(Aq => [ ], \& \*(Aqns.nic.se\*(Aq => [ \*(Aq212.247.7.228\*(Aq, \*(Aq2a00:801:f0:53::53\*(Aq ], \& \*(Aqi.ns.se\*(Aq => [ \*(Aq194.146.106.22\*(Aq, \*(Aq2001:67c:1010:5::53\*(Aq ], \& \*(Aqns3.nic.se\*(Aq => [ \*(Aq212.247.8.152\*(Aq, \*(Aq2a00:801:f0:211::152\*(Aq ] \& }, \& ); .Ve .Sp returns 1. .Sp .Vb 8 \& Zonemaster::Engine\->add_fake_delegation( \& \*(Aqlysator.liu.se\*(Aq => { \& \*(Aqns1.lysator.liu.se\*(Aq => [ ], \& \*(Aqns.nic.se\*(Aq => [ \*(Aq212.247.7.228\*(Aq, \*(Aq2a00:801:f0:53::53\*(Aq ], \& \*(Aqi.ns.se\*(Aq => [ \*(Aq194.146.106.22\*(Aq, \*(Aq2001:67c:1010:5::53\*(Aq ], \& \*(Aqns3.nic.se\*(Aq => [ \*(Aq212.247.8.152\*(Aq, \*(Aq2a00:801:f0:211::152\*(Aq ] \& } \& ); .Ve .Sp returns \f(CW\*(C`undef\*(C'\fR (signalling that fake delegation with empty glue was added to the system). .Sp .Vb 9 \& Zonemaster::Engine\->add_fake_delegation( \& \*(Aqlysator.liu.se\*(Aq => { \& \*(Aqns1.nic.fr\*(Aq => [ ], \& \*(Aqns.nic.se\*(Aq => [ \*(Aq212.247.7.228\*(Aq, \*(Aq2a00:801:f0:53::53\*(Aq ], \& \*(Aqi.ns.se\*(Aq => [ \*(Aq194.146.106.22\*(Aq, \*(Aq2001:67c:1010:5::53\*(Aq ], \& \*(Aqns3.nic.se\*(Aq => [ \*(Aq212.247.8.152\*(Aq, \*(Aq2a00:801:f0:211::152\*(Aq ] \& }, \& fill_in_empty_oob_glue => 0, \& ); .Ve .Sp returns 1. It does not even attempt to fill in glue for ns1.nic.fr. .ie n .IP "add_fake_ds($domain, $data)" 4 .el .IP "add_fake_ds($domain, \f(CW$data\fR)" 4 .IX Item "add_fake_ds($domain, $data)" This method adds fake DS records to the system. The arguments are a domain name, and a reference to a list of references to hashes. The hashes in turn must have the keys \f(CW\*(C`keytag\*(C'\fR, \f(CW\*(C`algorithm\*(C'\fR, \f(CW\*(C`type\*(C'\fR and \f(CW\*(C`digest\*(C'\fR, with the values holding the corresponding data. The digest data should be a single unbroken string of hexadecimal digits. .Sp Example: .Sp .Vb 6 \& Zonemaster::Engine\->add_fake_ds( \& \*(Aqnic.se\*(Aq => [ \& { keytag => 16696, algorithm => 5, type => 2, digest => \*(Aq40079DDF8D09E7F10BB248A69B6630478A28EF969DDE399F95BC3B39F8CBACD7\*(Aq }, \& { keytag => 16696, algorithm => 5, type => 1, digest => \*(AqEF5D421412A5EAF1230071AFFD4F585E3B2B1A60\*(Aq }, \& ] \& ); .Ve .IP \fBstart_time_now()\fR 4 .IX Item "start_time_now()" Set the logger's start time to the current time. .IP \fBreset()\fR 4 .IX Item "reset()" Reset logger start time to current time, empty the list of log messages, clear nameserver object cache and recursor cache. .SH AUTHORS .IX Header "AUTHORS" Vincent Levigneron \&\- Current maintainer .PP Calle Dybedahl \&\- Original author .SH LICENSE .IX Header "LICENSE" This is free software under a 2\-clause BSD license. The full text of the license can be found in the \fILICENSE\fR file included with this distribution.