The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Zonemaster::Engine::Recursor - recursive resolver for Zonemaster

SYNOPSIS

    my $packet = Zonemaster::Engine::Recursor->recurse($name, $type, $class);
    my $pname = Zonemaster::Engine::Recursor->parent('example.org');

CLASS VARIABLES

%recurse_cache

Will cache result of previous queries.

%_fake_addresses_cache

A hash of hashrefs of arrayrefs. The keys of the top level hash are domain names. The keys of the second level hashes are name server names (normalized to lower case). The elements of the third level arrayrefs are IP addresses.

The IP addresses are those of the nameservers which are used in case of fake delegations (pre-publication tests).

METHODS

recurse($name, $type, $class)

Does a recursive resolution from the root servers down for the given triplet.

parent($name)

Does a recursive resolution from the root down for the given name (using type SOA and class IN). If the resolution is successful, it returns the domain name of the second-to-last step. If the resolution is unsuccessful, it returns the domain name of the last step.

get_ns_from($packet, $state)

Internal method. Takes a packet and a recursion state and returns a list of ns objects. Used to follow redirections.

get_addresses_for($name[, $state])

Takes a name and returns a (possibly empty) list of IP addresses for that name (in the form of Zonemaster::Engine::Net::IP objects). When used internally by the recursor it's passed a recursion state as its second argument.

add_fake_addresses($domain, $data)

Class method to create fake adresses for fake delegations for a specified domain from data provided.

has_fake_addresses($domain)

Check if there is at least one fake nameserver specified for the given domain.

get_fake_addresses($domain, $nsname)

Returns a list of all cached fake addresses for the given domain and name server name. Returns an empty list if no data is cached for the given arguments.

clear_cache()

Class method to empty the cache of responses to recursive queries (but not the ones for fake delegations).

root_servers()

Returns a list of ns objects representing the root servers. The list of root servers is hardcoded into this module.