1Net::DNS::Resolver::RecUusresre(C3o)ntributed Perl DocumNeentt:a:tDiNoSn::Resolver::Recurse(3)
2
3
4
6 Net::DNS::Resolver::Recurse - Perform recursive dns lookups
7
9 use Net::DNS::Resolver::Recurse;
10 my $res = Net::DNS::Resolver::Recurse->new;
11
13 This module is a sub class of Net::DNS::Resolver. So the methods for
14 Net::DNS::Resolver still work for this module as well. There are just
15 a couple methods added:
16
17 hints
18
19 Initialize the hint servers. Recursive queries need a starting name
20 server to work off of. This method takes a list of IP addresses to use
21 as the starting servers. These name servers should be authoritative
22 for the root (.) zone.
23
24 $res->hints(@ips);
25
26 If no hints are passed, the default nameserver is asked for the hints.
27 Normally these IPs can be obtained from the following location:
28
29 ftp://ftp.internic.net/domain/named.root
30
31 recursion_callback
32
33 This method is takes a code reference, which is then invoked each time
34 a packet is received during the recursive lookup. For example to emu‐
35 late dig's "+trace" function:
36
37 $res->recursion_callback(sub {
38 my $packet = shift;
39
40 $_->print for $packet->additional;
41
42 printf(";; Received %d bytes from %s\n\n",
43 $packet->answersize,
44 $packet->answerfrom
45 );
46 });
47
48 query_dorecursion
49
50 This method is much like the normal query() method except it disables
51 the recurse flag in the packet and explicitly performs the recursion.
52
53 $packet = $res->query_dorecursion( "www.netscape.com.", "A");
54
56 If the appropriate IPv6 libraries are installed the recursive resolver
57 will randomly choose between IPv6 and IPv4 addresses of the nameservers
58 it encounters during recursion.
59
60 If you want to force IPv4 transport use the force_v4() method. Also see
61 the IPv6 transport notes in the Net::DNS::Resolver documentation.
62
64 Rob Brown, bbb@cpan.org
65
67 Net::DNS::Resolver,
68
70 Copyright (c) 2002, Rob Brown. All rights reserved. Portions Copy‐
71 right (c) 2005, Olaf M Kolkman.
72
73 This module is free software; you can redistribute it and/or modify it
74 under the same terms as Perl itself.
75
76 $Id: Recurse.pm 591 2006-05-22 21:32:38Z olaf $
77
78
79
80perl v5.8.8 2007-08-01 Net::DNS::Resolver::Recurse(3)