DNSCheck::Lookup::DNS(3)

sub query_nsid {
    my $self = shift;
    my $address = shift;
    my $qname = shift;
    my $qclass = shift;
    my $qtype = shift;

    unless ($self->_querible($address)) {
        return;
    }

    my $resolver = $self->_setup_resolver();
    $resolver->nameservers($address);

    $resolver->debug(1);

    my $optrr = new Net::DNS::RR {
        name          => "",
        type          => "OPT",
        class         => 1024,
        extendedrcode => 0x00,
        ednsflags     => 0x0000,
        optioncode    => 0x03,
        optiondata    => 0x00,
    };

    print Dumper($optrr);

    my $query = Net::DNS::Packet->new($qname, $qtype, $qclass);
    $query->push(additional => $optrr);
    $query->header->rd(0);
    $query->{'optadded'} = 1;

    print Dumper($query);

    my $response = $resolver->send($query);

    # FIXME: incomplete implementation

    return;
}

NAME
DNSCheck::Lookup::DNS - DNS Lookup

DESCRIPTION
Helper functions for looking up information in the DNS (Domain Name System).

METHODS

new($parent);
    Create a new lookup object. Not recommended to use, create a DNSCheck object and call the DNSCheck::dns method instead.

flush();
    Empty the cache and clear the blacklist.

my $packet = $dns->query_resolver(qname, qclass, qtype);
    Send a query to the default resolver(s). This will be a DNSCheck::Lookup::Resolver object.

my $packet = $dns->query_parent(zone, qname, qclass, qtype);
my $packet = $dns->query_child(zone, qname, qclass, qtype);
my $packet = $dns->query_explicit(qname, qclass, qtype, address, flags);
my $addrs = $dns->get_nameservers_ipv4(qname, qclass);
my $addrs = $dns->get_nameservers_ipv6(qname, qclass);
my $ns = $dns->get_nameservers_at_parent(qname, qclass);
my $ns = $dns->get_nameservers_at_child(qname, qclass);
$dns->init_nameservers(qname, qclass);
my $parent = $dns->find_parent(qname, qclass);
my @mx = $dns->find_mail_destination(domain);
my @addresses = $dns->find_addresses(qname, qclass);
my $bool = $dns->address_is_authoritative(address, qname, qtype);
my $bool = $dns->address_is_recursive(address, qclass);
my $bool = $dns->check_axfr(address, qname, qclass);
my $string = $dns->query_nsid(address, qname, qclass, qtype);
    These need to be documented better.

->add_blacklist($addr,$name,$class,$type)
    Add the given quadruple to the internal blacklist.

->check_blacklist($addr,$name,$class,$type)
    Return a true value if the given quadruple is in the internal blacklist.

->clear_blacklist()
    Clear the internal blacklist.

->check_timeout()
    Check if the current error in the underlying resolver object is a timeout.

->find_mx($zone)
    Return the hostname(s) to which mail to the given zone name should be directed.

->logger()
    Return a reference to the current logger object.

->parent()
    Return a reference to the current parent object.

->preflight_check($name)
    Do a quick and dirty guess about if the given name is a zone or not.

->query_child_nocache()
    The same as query_child(), but bypasses the internal cache.

->query_parent_nocache()
    The same as query_parent(), but bypasses the internal cache.

->resolver()
    Returns a reference to the underlying DNSCheck::Lookup::Resolver object.

EXAMPLES
    use DNSCheck::Logger;
    use DNSCheck::Lookup::DNS;

    my $logger = new DNSCheck::Logger;
    my $dns    = new DNSCheck::Lookup::DNS($logger);

    my $parent = $dns->query_parent("nic.se", "ns.nic.se", "IN", "A");

    $logger->dump();

SEE ALSO
DNSCheck::Logger, DNSCheck::Lookup::DNS