Home: Perl Programming Help: Advanced:
Net::DNS timeout


Nov 2, 2000, 3:48 PM

Views: 1644
Net::DNS timeout

Hi everyone.

I am using Perl and the module Net::DNS for performing a zone transfer.
My problem is that I create a resolver object that seems to ignore the "timeout" parameter I set.

I put the code here:


#!/usr/bin/perl -w

use Net::DNS ;

my $res = new Net::DNS::Resolver;

$res->tcp_timeout (1) ;
$res->retry (1) ;
$res->retrans (1) ;
print "before transfer" ;
print "timeout: ", $res->tcp_timeout, "\n" ;
print " retrys: ", $res->retry, "\n";
print " retrans: ", $res->retrans, "\n";
my @records = $res->axfr("uy.");
foreach (@records) {
$_->print ;
print "after transfer " ;


The programs works well when the nameserver works well, but the nameserver "UUCP-GW-2.PA.DEC.COM" sometimes works but sometimes delays a long time.
I want the resolver to wait no more than 1 second, retry 1 time and wait 1 second before retrys..
The "prints" do print the right values (1, 1, 1), but after printing "retrans" the program delays for some minutes...

Thank you..