1Net::DNS::Resolver::RecUusresre(C3o)ntributed Perl DocumNeentt:a:tDiNoSn::Resolver::Recurse(3)
2
3
4
6 Net::DNS::Resolver::Recurse - DNS recursive resolver
7
9 use Net::DNS::Resolver::Recurse;
10
11 my $resolver = new Net::DNS::Resolver::Recurse();
12 $resolver->debug(1);
13
14 $resolver->hints('198.41.0.4'); # A.ROOT-SERVER.NET.
15
16 my $packet = $resolver->send( 'www.rob.com.au.', 'A' );
17
19 This module is a subclass of Net::DNS::Resolver.
20
22 This module inherits almost all the methods from Net::DNS::Resolver.
23 Additional module-specific methods are described below.
24
25 hints
26 This method specifies a list of the IP addresses of nameservers to be
27 used to discover the addresses of the root nameservers.
28
29 $resolver->hints(@ip);
30
31 If no hints are passed, the priming query is directed to nameservers
32 drawn from a built-in list of IP addresses.
33
34 query, search, send
35 The query(), search() and send() methods produce the same result as
36 their counterparts in Net::DNS::Resolver.
37
38 $packet = $resolver->send( 'www.example.com.', 'A' );
39
40 Server-side recursion is suppressed by clearing the recurse flag in
41 query packets and recursive name resolution is performed explicitly.
42
43 The query() and search() methods are inherited from Net::DNS::Resolver
44 and invoke send() indirectly.
45
46 callback
47 This method specifies a code reference to a subroutine, which is then
48 invoked at each stage of the recursive lookup.
49
50 For example to emulate dig's "+trace" function:
51
52 my $coderef = sub {
53 my $packet = shift;
54
55 printf ";; Received %d bytes from %s\n\n",
56 $packet->answersize, $packet->answerfrom;
57 };
58
59 $resolver->callback($coderef);
60
61 The callback subroutine is not called for queries for missing glue
62 records.
63
65 This package is an improved and compatible reimplementation of the
66 Net::DNS::Resolver::Recurse.pm created by Rob Brown in 2002, whose
67 contribution is gratefully acknowledged.
68
70 Copyright (c)2014,2019 Dick Franks.
71
72 Portions Copyright (c)2002 Rob Brown.
73
74 All rights reserved.
75
77 Permission to use, copy, modify, and distribute this software and its
78 documentation for any purpose and without fee is hereby granted,
79 provided that the original copyright notices appear in all copies and
80 that both copyright notice and this permission notice appear in
81 supporting documentation, and that the name of the author not be used
82 in advertising or publicity pertaining to distribution of the software
83 without specific prior written permission.
84
85 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
86 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
87 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
88 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
89 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
90 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
91 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
92
94 Net::DNS::Resolver
95
96
97
98perl v5.34.1 2022-06-08 Net::DNS::Resolver::Recurse(3)