Net::DNS::Resolver::Recurse - Perform recursive DNS lookups
use Net::DNS::Resolver::Recurse; my $res = Net::DNS::Resolver::Recurse->new;
This module is a sub class of Net::DNS::Resolver.
This module inherits all the methods from Net::DNS::Resolver. The additional module-specific methods are described below.
Initialize the hint servers. Recursive queries need a starting name server to work from. This method takes a list of IP addresses to use as the starting servers. These name servers should be authoritative for the root (.) zone.
$res->hints(@ips);
If no hints are passed, the default nameserver is asked for the hints. Normally these IPs can be obtained from the following location:
ftp://ftp.internic.net/domain/named.root
This method is takes a code reference, which is then invoked each time a packet is received during the recursive lookup. For example to emulate dig's +trace function:
+trace
$res->recursion_callback(sub { my $packet = shift; $_->print for $packet->additional; printf(";; Received %d bytes from %s\n\n", $packet->answersize, $packet->answerfrom ); });
This method is much like the normal query() method except it disables the recurse flag in the packet and explicitly performs the recursion.
$packet = $res->query_dorecursion( "www.netscape.com.", "A");
If the appropriate IPv6 libraries are installed the recursive resolver will randomly choose between IPv6 and IPv4 addresses of the nameservers it encounters during recursion.
If you want to force IPv4 transport use the force_v4() method. Also see the IPv6 transport notes in the Net::DNS::Resolver documentation.
Rob Brown, bbb@cpan.org
Copyright (c)2002, Rob Brown.
Portions Copyright (c)2005, Olaf M Kolkman.
All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Net::DNS::Resolver
To install Net::DNS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::DNS
CPAN shell
perl -MCPAN -e shell install Net::DNS
For more information on module installation, please visit the detailed CPAN module installation guide.