Afnic and IIS Zonemaster Project
and 1 contributors


Zonemaster::Engine - A tool to check the quality of a DNS zone


    my @results = Zonemaster::Engine->test_zone('')


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.



Runs all available tests and returns a list of Zonemaster::Engine::Logger::Entry objects.

test_module($module, $name)

Runs all available tests for the zone with the given name in the specified module.

test_method($module, $method, @arguments)

Run one particular test method in one particular module. 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 policy), 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.


Returns a Zonemaster::Engine::Zone object for the given name.

ns($name, $address)

Returns a Zonemaster::Engine::Nameserver object for the given name and address.


Returns the global Zonemaster::Engine::Config object.


Returns the global Zonemaster::Engine::Logger object.


Returns a list of all the tags that can be logged for all avilable test modules.


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.

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.


In case of critical condition that prevents tool to process tests, add test here and return False.


After running the tests, save the accumulated cache to a file with the given name.


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 "save_cache()".


Takes a single IP address and returns one of three things:

  • Nothing, if the IP address is not in any AS.

  • If called in list context, a list of AS number and a Net::IP::XS object representing the prefix it's in.

  • If called in scalar context, only the AS number.


Returns a list of the loaded test modules. Exactly the same as "modules" in Zonemaster::Engine::Test.

add_fake_delegation($domain, $data)

This method adds some fake delegation information to the system. The arguments are a domain name, and a reference to a hash with delegation information. The keys in the hash must be nameserver names, and the values references to lists of IP addresses (which can be left empty) for the corresponding nameserver. If IP addresses are not provided for nameservers, the engine will perform queries to find them, except for in-bailiwick nameservers. All IP addresses found/provided are then used to initialize %Zonemaster::Engine::Recursor::fake_addresses_cache for later usage. If all servers can be associated to IP addresses, add_fake_delegation method returns 1, 'undef' otherwise.


        '' => {
            '' => [ ],
            ''  => [ '',  '2a00:801:f0:53::53' ],
            ''    => [ '', '2001:67c:1010:5::53' ],
            '' => [ '',  '2a00:801:f0:211::152' ]

will return 1.

        '' => {
            '' => [ ],
            ''  => [ '',  '2a00:801:f0:53::53' ],
            ''    => [ '', '2001:67c:1010:5::53' ],
            '' => [ '',  '2a00:801:f0:211::152' ]

will return 'undef' (missing address for

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 keytag, algorithm, type and digest, with the values holding the corresponding data. The digest data should be a single unbroken string of hexadecimal digits.


      '' => [
         { keytag => 16696, algorithm => 5, type => 2, digest => '40079DDF8D09E7F10BB248A69B6630478A28EF969DDE399F95BC3B39F8CBACD7' },
         { keytag => 16696, algorithm => 5, type => 1, digest => 'EF5D421412A5EAF1230071AFFD4F585E3B2B1A60' },

Set the logger's start time to the current time.


Reset logger start time to current time, empty the list of log messages, clear nameserver object cache and recursor cache.


Vincent Levigneron <vincent.levigneron at> - Current maintainer

Calle Dybedahl <calle at> - Original author


This is free software, licensed under:

The (three-clause) BSD License

The full text of the license can be found in the LICENSE file included with this distribution.