Description : when I run 10, 100, or 1000 times the following programm
(A), it's working fine. But sometimes, I get a DNS "Server Failure" from
the Name Server.
--> When receiving this packet, program is aborting whit an error
message (B).
File joined : Wireshark capture of packet exchange.
# (A) ############# PERL CODE ########################################
use strict;
use Net::DNS;
my $site = "www.cisco.com";
my $nameServer = "4.2.2.1";
my $res = Net::DNS::Resolver->new;
$res->nameservers($nameServer);
# +--------------------------------+
# | PROGRAMM ABORTED AT THIS POINT |
# +--------------------------------+
my $query = $res->search("$site.");
if ($query) {
foreach my $rr ($query->answer) {
next unless $rr->type eq "A";
print $rr->address, "\n";
}
} else {
warn "query failed: ", $res->errorstring, "\n";
}
# (B) ################# ERROR CODE ###########################
Can't call method "qtype" on an undefined value at
C:/Perl/site/lib/Net/DNS/Resolver/Base.pm line 434, <FILE> line 1.
Subject: | failure.pcap |
Message body not shown because it is not plain text.