ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/lib/AnyEvent/DNS.pm
(Generate patch)

Comparing AnyEvent/lib/AnyEvent/DNS.pm (file contents):
Revision 1.53 by root, Fri May 30 09:40:41 2008 UTC vs.
Revision 1.91 by root, Wed May 13 13:36:49 2009 UTC

2 2
3AnyEvent::DNS - fully asynchronous DNS resolution 3AnyEvent::DNS - fully asynchronous DNS resolution
4 4
5=head1 SYNOPSIS 5=head1 SYNOPSIS
6 6
7 use AnyEvent::DNS; 7 use AnyEvent::DNS;
8 8
9 my $cv = AnyEvent->condvar; 9 my $cv = AnyEvent->condvar;
10 AnyEvent::DNS::a "www.google.de", $cv; 10 AnyEvent::DNS::a "www.google.de", $cv;
11 # ... later 11 # ... later
12 my @addrs = $cv->recv; 12 my @addrs = $cv->recv;
13 13
14=head1 DESCRIPTION 14=head1 DESCRIPTION
15 15
16This module offers both a number of DNS convenience functions as well 16This module offers both a number of DNS convenience functions as well
17as a fully asynchronous and high-performance pure-perl stub resolver. 17as a fully asynchronous and high-performance pure-perl stub resolver.
35 35
36use AnyEvent (); 36use AnyEvent ();
37use AnyEvent::Handle (); 37use AnyEvent::Handle ();
38use AnyEvent::Util qw(AF_INET6); 38use AnyEvent::Util qw(AF_INET6);
39 39
40our $VERSION = '1.0'; 40our $VERSION = 4.41;
41 41
42our @DNS_FALLBACK = (v208.67.220.220, v208.67.222.222); 42our @DNS_FALLBACK = (v208.67.220.220, v208.67.222.222);
43 43
44=item AnyEvent::DNS::a $domain, $cb->(@addrs) 44=item AnyEvent::DNS::a $domain, $cb->(@addrs)
45 45
65=item AnyEvent::DNS::srv $service, $proto, $domain, $cb->(@srv_rr) 65=item AnyEvent::DNS::srv $service, $proto, $domain, $cb->(@srv_rr)
66 66
67Tries to resolve the given service, protocol and domain name into a list 67Tries to resolve the given service, protocol and domain name into a list
68of service records. 68of service records.
69 69
70Each srv_rr is an array reference with the following contents: 70Each C<$srv_rr> is an array reference with the following contents:
71C<[$priority, $weight, $transport, $target]>. 71C<[$priority, $weight, $transport, $target]>.
72 72
73They will be sorted with lowest priority first, then randomly 73They will be sorted with lowest priority first, then randomly
74distributed by weight as per RFC 2782. 74distributed by weight as per RFC 2782.
75 75
170 my %pri; 170 my %pri;
171 push @{ $pri{$_->[3]} }, [ @$_[3,4,5,6] ] 171 push @{ $pri{$_->[3]} }, [ @$_[3,4,5,6] ]
172 for @_; 172 for @_;
173 173
174 # order by priority 174 # order by priority
175 for my $pri (sort { $a->[0] <=> $b->[0] } keys %pri) { 175 for my $pri (sort { $a <=> $b } keys %pri) {
176 # order by weight 176 # order by weight
177 my @rr = sort { $a->[1] <=> $b->[1] } @{ delete $pri{$pri} }; 177 my @rr = sort { $a->[1] <=> $b->[1] } @{ delete $pri{$pri} };
178 178
179 my $sum; $sum += $_->[1] for @rr; 179 my $sum; $sum += $_->[1] for @rr;
180 180
265 ptr $ptr, sub { 265 ptr $ptr, sub {
266 for my $name (@_) { 266 for my $name (@_) {
267 ++$cnt; 267 ++$cnt;
268 268
269 # () around AF_INET to work around bug in 5.8 269 # () around AF_INET to work around bug in 5.8
270 resolver->resolve ($name => ($af == (AF_INET) ? "a" : "aaaa"), sub { 270 resolver->resolve ("$name." => ($af == (AF_INET) ? "a" : "aaaa"), sub {
271 for (@_) { 271 for (@_) {
272 push @res, $name 272 push @res, $name
273 if $_->[3] eq $ip; 273 if $_->[3] eq $ip;
274 } 274 }
275 $cb->(@res) unless --$cnt; 275 $cb->(@res) unless --$cnt;
352 mx => 15, 352 mx => 15,
353 txt => 16, 353 txt => 16,
354 aaaa => 28, 354 aaaa => 28,
355 srv => 33, 355 srv => 33,
356 naptr => 35, # rfc2915 356 naptr => 35, # rfc2915
357 dname => 39, # rfc2672
357 opt => 41, 358 opt => 41,
358 spf => 99, 359 spf => 99,
359 tkey => 249, 360 tkey => 249,
360 tsig => 250, 361 tsig => 250,
361 ixfr => 251, 362 ixfr => 251,
397 398
398Resource records are not yet encodable. 399Resource records are not yet encodable.
399 400
400Examples: 401Examples:
401 402
402 # very simple request, using lots of default values: 403 # very simple request, using lots of default values:
403 { rd => 1, qd => [ [ "host.domain", "a"] ] } 404 { rd => 1, qd => [ [ "host.domain", "a"] ] }
404 405
405 # more complex example, showing how flags etc. are named: 406 # more complex example, showing how flags etc. are named:
406 407
407 { 408 {
408 id => 10000, 409 id => 10000,
409 op => "query", 410 op => "query",
410 rc => "nxdomain", 411 rc => "nxdomain",
411 412
412 # flags 413 # flags
413 qr => 1, 414 qr => 1,
414 aa => 0, 415 aa => 0,
415 tc => 0, 416 tc => 0,
416 rd => 0, 417 rd => 0,
417 ra => 0, 418 ra => 0,
418 ad => 0, 419 ad => 0,
419 cd => 0, 420 cd => 0,
420 421
421 qd => [@rr], # query section 422 qd => [@rr], # query section
422 an => [@rr], # answer section 423 an => [@rr], # answer section
423 ns => [@rr], # authority section 424 ns => [@rr], # authority section
424 ar => [@rr], # additional records section 425 ar => [@rr], # additional records section
425 } 426 }
426 427
427=cut 428=cut
428 429
429sub dns_pack($) { 430sub dns_pack($) {
430 my ($req) = @_; 431 my ($req) = @_;
506 15 => sub { local $ofs = $ofs + 2 - length; ((unpack "n", $_), _dec_name) }, # mx 507 15 => sub { local $ofs = $ofs + 2 - length; ((unpack "n", $_), _dec_name) }, # mx
507 16 => sub { unpack "(C/a*)*", $_ }, # txt 508 16 => sub { unpack "(C/a*)*", $_ }, # txt
508 28 => sub { AnyEvent::Socket::format_address ($_) }, # aaaa 509 28 => sub { AnyEvent::Socket::format_address ($_) }, # aaaa
509 33 => sub { local $ofs = $ofs + 6 - length; ((unpack "nnn", $_), _dec_name) }, # srv 510 33 => sub { local $ofs = $ofs + 6 - length; ((unpack "nnn", $_), _dec_name) }, # srv
510 35 => sub { # naptr 511 35 => sub { # naptr
512 # requires perl 5.10, sorry
511 my ($order, $preference, $flags, $service, $regexp, $offset) = unpack "nn C/a* C/a* C/a* .", $_; 513 my ($order, $preference, $flags, $service, $regexp, $offset) = unpack "nn C/a* C/a* C/a* .", $_;
512 local $ofs = $ofs + $offset - length; 514 local $ofs = $ofs + $offset - length;
513 ($order, $preference, $flags, $service, $regexp, _dec_name) 515 ($order, $preference, $flags, $service, $regexp, _dec_name)
514 }, 516 },
517 39 => sub { local $ofs = $ofs - length; _dec_name }, # dname
515 99 => sub { unpack "(C/a*)*", $_ }, # spf 518 99 => sub { unpack "(C/a*)*", $_ }, # spf
516); 519);
517 520
518sub _dec_rr { 521sub _dec_rr {
519 my $name = _dec_name; 522 my $name = _dec_name;
533 536
534Unpacks a DNS packet into a perl data structure. 537Unpacks a DNS packet into a perl data structure.
535 538
536Examples: 539Examples:
537 540
538 # an unsuccessful reply 541 # an unsuccessful reply
539 { 542 {
540 'qd' => [ 543 'qd' => [
541 [ 'ruth.plan9.de.mach.uni-karlsruhe.de', '*', 'in' ] 544 [ 'ruth.plan9.de.mach.uni-karlsruhe.de', '*', 'in' ]
542 ], 545 ],
543 'rc' => 'nxdomain', 546 'rc' => 'nxdomain',
544 'ar' => [], 547 'ar' => [],
545 'ns' => [ 548 'ns' => [
546 [ 549 [
547 'uni-karlsruhe.de', 550 'uni-karlsruhe.de',
548 'soa', 551 'soa',
549 'in', 552 'in',
550 'netserv.rz.uni-karlsruhe.de', 553 'netserv.rz.uni-karlsruhe.de',
551 'hostmaster.rz.uni-karlsruhe.de', 554 'hostmaster.rz.uni-karlsruhe.de',
552 2008052201, 10800, 1800, 2592000, 86400 555 2008052201, 10800, 1800, 2592000, 86400
553 ] 556 ]
554 ], 557 ],
555 'tc' => '', 558 'tc' => '',
556 'ra' => 1, 559 'ra' => 1,
557 'qr' => 1, 560 'qr' => 1,
558 'id' => 45915, 561 'id' => 45915,
559 'aa' => '', 562 'aa' => '',
560 'an' => [], 563 'an' => [],
561 'rd' => 1, 564 'rd' => 1,
562 'op' => 'query' 565 'op' => 'query'
563 } 566 }
564 567
565 # a successful reply 568 # a successful reply
566 569
567 { 570 {
568 'qd' => [ [ 'www.google.de', 'a', 'in' ] ], 571 'qd' => [ [ 'www.google.de', 'a', 'in' ] ],
569 'rc' => 0, 572 'rc' => 0,
570 'ar' => [ 573 'ar' => [
571 [ 'a.l.google.com', 'a', 'in', '209.85.139.9' ], 574 [ 'a.l.google.com', 'a', 'in', '209.85.139.9' ],
572 [ 'b.l.google.com', 'a', 'in', '64.233.179.9' ], 575 [ 'b.l.google.com', 'a', 'in', '64.233.179.9' ],
573 [ 'c.l.google.com', 'a', 'in', '64.233.161.9' ], 576 [ 'c.l.google.com', 'a', 'in', '64.233.161.9' ],
574 ], 577 ],
575 'ns' => [ 578 'ns' => [
576 [ 'l.google.com', 'ns', 'in', 'a.l.google.com' ], 579 [ 'l.google.com', 'ns', 'in', 'a.l.google.com' ],
577 [ 'l.google.com', 'ns', 'in', 'b.l.google.com' ], 580 [ 'l.google.com', 'ns', 'in', 'b.l.google.com' ],
578 ], 581 ],
579 'tc' => '', 582 'tc' => '',
580 'ra' => 1, 583 'ra' => 1,
581 'qr' => 1, 584 'qr' => 1,
582 'id' => 64265, 585 'id' => 64265,
583 'aa' => '', 586 'aa' => '',
584 'an' => [ 587 'an' => [
585 [ 'www.google.de', 'cname', 'in', 'www.google.com' ], 588 [ 'www.google.de', 'cname', 'in', 'www.google.com' ],
586 [ 'www.google.com', 'cname', 'in', 'www.l.google.com' ], 589 [ 'www.google.com', 'cname', 'in', 'www.l.google.com' ],
587 [ 'www.l.google.com', 'a', 'in', '66.249.93.104' ], 590 [ 'www.l.google.com', 'a', 'in', '66.249.93.104' ],
588 [ 'www.l.google.com', 'a', 'in', '66.249.93.147' ], 591 [ 'www.l.google.com', 'a', 'in', '66.249.93.147' ],
589 ], 592 ],
590 'rd' => 1, 593 'rd' => 1,
591 'op' => 0 594 'op' => 0
592 } 595 }
593 596
594=cut 597=cut
595 598
596sub dns_unpack($) { 599sub dns_unpack($) {
597 local $pkt = shift; 600 local $pkt = shift;
698been resolved. 701been resolved.
699 702
700=item reuse => $seconds 703=item reuse => $seconds
701 704
702The number of seconds (default: C<300>) that a query id cannot be re-used 705The number of seconds (default: C<300>) that a query id cannot be re-used
703after a timeout. If there as no time-out then query id's can be reused 706after a timeout. If there was no time-out then query ids can be reused
704immediately. 707immediately.
705 708
706=back 709=back
707 710
708=cut 711=cut
709 712
710sub new { 713sub new {
711 my ($class, %arg) = @_; 714 my ($class, %arg) = @_;
712
713 # try to create a ipv4 and an ipv6 socket
714 # only fail when we cnanot create either
715
716 socket my $fh4, AF_INET , &Socket::SOCK_DGRAM, 0;
717 socket my $fh6, AF_INET6, &Socket::SOCK_DGRAM, 0;
718
719 $fh4 || $fh6
720 or Carp::croak "unable to create either an IPv6 or an IPv4 socket";
721 715
722 my $self = bless { 716 my $self = bless {
723 server => [], 717 server => [],
724 timeout => [2, 5, 5], 718 timeout => [2, 5, 5],
725 search => [], 719 search => [],
726 ndots => 1, 720 ndots => 1,
727 max_outstanding => 10, 721 max_outstanding => 10,
728 reuse => 300, # reuse id's after 5 minutes only, if possible 722 reuse => 300,
729 %arg, 723 %arg,
730 reuse_q => [], 724 reuse_q => [],
731 }, $class; 725 }, $class;
732 726
733 # search should default to gethostname's domain 727 # search should default to gethostname's domain
734 # but perl lacks a good posix module 728 # but perl lacks a good posix module
735 729
730 # try to create an ipv4 and an ipv6 socket
731 # only fail when we cannot create either
732 my $got_socket;
733
736 Scalar::Util::weaken (my $wself = $self); 734 Scalar::Util::weaken (my $wself = $self);
737 735
738 if ($fh4) { 736 if (socket my $fh4, AF_INET , &Socket::SOCK_DGRAM, 0) {
737 ++$got_socket;
738
739 AnyEvent::Util::fh_nonblocking $fh4, 1; 739 AnyEvent::Util::fh_nonblocking $fh4, 1;
740 $self->{fh4} = $fh4; 740 $self->{fh4} = $fh4;
741 $self->{rw4} = AnyEvent->io (fh => $fh4, poll => "r", cb => sub { 741 $self->{rw4} = AnyEvent->io (fh => $fh4, poll => "r", cb => sub {
742 if (my $peer = recv $fh4, my $pkt, MAX_PKT, 0) { 742 if (my $peer = recv $fh4, my $pkt, MAX_PKT, 0) {
743 $wself->_recv ($pkt, $peer); 743 $wself->_recv ($pkt, $peer);
744 } 744 }
745 }); 745 });
746 } 746 }
747 747
748 if ($fh6) { 748 if (AF_INET6 && socket my $fh6, AF_INET6, &Socket::SOCK_DGRAM, 0) {
749 ++$got_socket;
750
749 $self->{fh6} = $fh6; 751 $self->{fh6} = $fh6;
750 AnyEvent::Util::fh_nonblocking $fh6, 1; 752 AnyEvent::Util::fh_nonblocking $fh6, 1;
751 $self->{rw6} = AnyEvent->io (fh => $fh6, poll => "r", cb => sub { 753 $self->{rw6} = AnyEvent->io (fh => $fh6, poll => "r", cb => sub {
752 if (my $peer = recv $fh6, my $pkt, MAX_PKT, 0) { 754 if (my $peer = recv $fh6, my $pkt, MAX_PKT, 0) {
753 $wself->_recv ($pkt, $peer); 755 $wself->_recv ($pkt, $peer);
754 } 756 }
755 }); 757 });
756 } 758 }
759
760 $got_socket
761 or Carp::croak "unable to create either an IPv4 or an IPv6 socket";
757 762
758 $self->_compile; 763 $self->_compile;
759 764
760 $self 765 $self
761} 766}
838 # - the registry thing needs separate code on win32 native vs. cygwin 843 # - the registry thing needs separate code on win32 native vs. cygwin
839 # - the registry layout differs between windows versions 844 # - the registry layout differs between windows versions
840 # - calling windows api functions doesn't work on cygwin 845 # - calling windows api functions doesn't work on cygwin
841 # - ipconfig uses locale-specific messages 846 # - ipconfig uses locale-specific messages
842 847
843 # we use ipconfig parsing because, despite all it's brokenness, 848 # we use ipconfig parsing because, despite all its brokenness,
844 # it seems most stable in practise. 849 # it seems most stable in practise.
845 # for good measure, we append a fallback nameserver to our list. 850 # for good measure, we append a fallback nameserver to our list.
846 851
847 if (open my $fh, "ipconfig /all |") { 852 if (open my $fh, "ipconfig /all |") {
848 # parsing strategy: we go through the output and look for 853 # parsing strategy: we go through the output and look for
857 } elsif (/^\S/ || /^\s[^:]{16,}: /) { 862 } elsif (/^\S/ || /^\s[^:]{16,}: /) {
858 $dns = 0; 863 $dns = 0;
859 } 864 }
860 if ($dns && /^\s*(\S+)\s*$/) { 865 if ($dns && /^\s*(\S+)\s*$/) {
861 my $s = $1; 866 my $s = $1;
862 $s =~ s/%\d+(?!\S)//; # get rid of scope id 867 $s =~ s/%\d+(?!\S)//; # get rid of ipv6 scope id
863 if (my $ipn = AnyEvent::Socket::parse_address ($s)) { 868 if (my $ipn = AnyEvent::Socket::parse_address ($s)) {
864 push @{ $self->{server} }, $ipn; 869 push @{ $self->{server} }, $ipn;
865 } else { 870 } else {
866 push @{ $self->{search} }, $s; 871 push @{ $self->{search} }, $s;
867 } 872 }
884} 889}
885 890
886=item $resolver->timeout ($timeout, ...) 891=item $resolver->timeout ($timeout, ...)
887 892
888Sets the timeout values. See the C<timeout> constructor argument (and note 893Sets the timeout values. See the C<timeout> constructor argument (and note
889that this method uses the values itselt, not an array-reference). 894that this method uses the values itself, not an array-reference).
890 895
891=cut 896=cut
892 897
893sub timeout { 898sub timeout {
894 my ($self, @timeout) = @_; 899 my ($self, @timeout) = @_;
995 1000
996 $self->{id}{$req->[2]} = [AnyEvent->timer (after => $timeout, cb => sub { 1001 $self->{id}{$req->[2]} = [AnyEvent->timer (after => $timeout, cb => sub {
997 $NOW = time; 1002 $NOW = time;
998 1003
999 # timeout, try next 1004 # timeout, try next
1000 &$do_retry; 1005 &$do_retry if $do_retry;
1001 }), sub { 1006 }), sub {
1002 my ($res) = @_; 1007 my ($res) = @_;
1003 1008
1004 if ($res->{tc}) { 1009 if ($res->{tc}) {
1005 # success, but truncated, so use tcp 1010 # success, but truncated, so use tcp
1094 } 1099 }
1095} 1100}
1096 1101
1097=item $resolver->request ($req, $cb->($res)) 1102=item $resolver->request ($req, $cb->($res))
1098 1103
1104This is the main low-level workhorse for sending DNS requests.
1105
1099Sends a single request (a hash-ref formated as specified for 1106This function sends a single request (a hash-ref formated as specified
1100C<dns_pack>) to the configured nameservers including 1107for C<dns_pack>) to the configured nameservers in turn until it gets a
1108response. It handles timeouts, retries and automatically falls back to
1109virtual circuit mode (TCP) when it receives a truncated reply.
1110
1101retries. Calls the callback with the decoded response packet if a reply 1111Calls the callback with the decoded response packet if a reply was
1102was received, or no arguments on timeout. 1112received, or no arguments in case none of the servers answered.
1103 1113
1104=cut 1114=cut
1105 1115
1106sub request($$) { 1116sub request($$) {
1107 my ($self, $req, $cb) = @_; 1117 my ($self, $req, $cb) = @_;
1108 1118
1109 push @{ $self->{queue} }, [dns_pack $req, $cb]; 1119 push @{ $self->{queue} }, [dns_pack $req, $cb];
1110 $self->_scheduler; 1120 $self->_scheduler;
1111} 1121}
1112 1122
1113=item $resolver->resolve ($qname, $qtype, %options, $cb->($rcode, @rr)) 1123=item $resolver->resolve ($qname, $qtype, %options, $cb->(@rr))
1114 1124
1115Queries the DNS for the given domain name C<$qname> of type C<$qtype>. 1125Queries the DNS for the given domain name C<$qname> of type C<$qtype>.
1116 1126
1117A C<$qtype> is either a numerical query type (e.g. C<1> for A recods) or 1127A C<$qtype> is either a numerical query type (e.g. C<1> for A records) or
1118a lowercase name (you have to look at the source to see which aliases are 1128a lowercase name (you have to look at the source to see which aliases are
1119supported, but all types from RFC 1035, C<aaaa>, C<srv>, C<spf> and a few 1129supported, but all types from RFC 1035, C<aaaa>, C<srv>, C<spf> and a few
1120more are known to this module). A qtype of "*" is supported and means 1130more are known to this module). A C<$qtype> of "*" is supported and means
1121"any" record type. 1131"any" record type.
1122 1132
1123The callback will be invoked with a list of matching result records or 1133The callback will be invoked with a list of matching result records or
1124none on any error or if the name could not be found. 1134none on any error or if the name could not be found.
1125 1135
1126CNAME chains (although illegal) are followed up to a length of 8. 1136CNAME chains (although illegal) are followed up to a length of 10.
1127 1137
1128The callback will be invoked with an result code in string form (noerror, 1138The callback will be invoked with arraryefs of the form C<[$name, $type,
1129formerr, servfail, nxdomain, notimp, refused and so on), or numerical 1139$class, @data>], where C<$name> is the domain name, C<$type> a type string
1130form if the result code is not supported. The remaining arguments are 1140or number, C<$class> a class name and @data is resource-record-dependent
1131arraryefs of the form C<[$name, $type, $class, @data>], where C<$name> is 1141data. For C<a> records, this will be the textual IPv4 addresses, for C<ns>
1132the domain name, C<$type> a type string or number, C<$class> a class name 1142or C<cname> records this will be a domain name, for C<txt> records these
1133and @data is resource-record-dependent data. For C<a> records, this will 1143are all the strings and so on.
1134be the textual IPv4 addresses, for C<ns> or C<cname> records this will be
1135a domain name, for C<txt> records these are all the strings and so on.
1136 1144
1137All types mentioned in RFC 1035, C<aaaa>, C<srv> and C<spf> are 1145All types mentioned in RFC 1035, C<aaaa>, C<srv>, C<naptr> and C<spf> are
1138decoded. All resource records not known to this module will just return 1146decoded. All resource records not known to this module will have
1139the raw C<rdata> field as fourth entry. 1147the raw C<rdata> field as fourth entry.
1140 1148
1141Note that this resolver is just a stub resolver: it requires a name server 1149Note that this resolver is just a stub resolver: it requires a name server
1142supporting recursive queries, will not do any recursive queries itself and 1150supporting recursive queries, will not do any recursive queries itself and
1143is not secure when used against an untrusted name server. 1151is not secure when used against an untrusted name server.
1148 1156
1149=item search => [$suffix...] 1157=item search => [$suffix...]
1150 1158
1151Use the given search list (which might be empty), by appending each one 1159Use the given search list (which might be empty), by appending each one
1152in turn to the C<$qname>. If this option is missing then the configured 1160in turn to the C<$qname>. If this option is missing then the configured
1153C<ndots> and C<search> define its value. If the C<$qname> ends in a dot, 1161C<ndots> and C<search> values define its value (depending on C<ndots>, the
1154then the searchlist will be ignored. 1162empty suffix will be prepended or appended to that C<search> value). If
1163the C<$qname> ends in a dot, then the searchlist will be ignored.
1155 1164
1156=item accept => [$type...] 1165=item accept => [$type...]
1157 1166
1158Lists the acceptable result types: only result types in this set will be 1167Lists the acceptable result types: only result types in this set will be
1159accepted and returned. The default includes the C<$qtype> and nothing 1168accepted and returned. The default includes the C<$qtype> and nothing
1237 $do_search = sub { 1246 $do_search = sub {
1238 @search 1247 @search
1239 or (undef $do_search), (undef $do_req), return $cb->(); 1248 or (undef $do_search), (undef $do_req), return $cb->();
1240 1249
1241 (my $name = lc "$qname." . shift @search) =~ s/\.$//; 1250 (my $name = lc "$qname." . shift @search) =~ s/\.$//;
1242 my $depth = 2; 1251 my $depth = 10;
1243 1252
1244 # advance in cname-chain 1253 # advance in cname-chain
1245 $do_req = sub { 1254 $do_req = sub {
1246 $self->request ({ 1255 $self->request ({
1247 rd => 1, 1256 rd => 1,
1324 1333
1325=back 1334=back
1326 1335
1327=head1 AUTHOR 1336=head1 AUTHOR
1328 1337
1329 Marc Lehmann <schmorp@schmorp.de> 1338 Marc Lehmann <schmorp@schmorp.de>
1330 http://home.schmorp.de/ 1339 http://home.schmorp.de/
1331 1340
1332=cut 1341=cut
1333 1342

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines