Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

timeout in Net:::DNS

Status
Not open for further replies.

emilio500

Programmer
Oct 15, 2000
9
0
0
UY
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->nameservers("UUCP-GW-2.PA.DEC.COM");
$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..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top