[Mimedefang] long dns timeouts when first dns in /etc/resolv.conf is down
Dianne Skoll
dfs at roaringpenguin.com
Mon Mar 14 10:06:00 EDT 2016
On Mon, 14 Mar 2016 14:11:38 +0100
Marcus Schopen <lists at localguru.de> wrote:
> It shouldn't make a difference to mimedefang if one of
> the dns server is down. Any ideas?
I think this is an artifact of the Net::DNS Perl module, which doesn't
seem to handle multiple name servers very well.
I ran the following test program, where 10.50.100.100 is a nonexistent
machine and 192.168.10.23 is the real name server. Results of strace are
shown below; it seems by default that Net::DNS only moves to the next name
server after 10s. If you do lots of DNS lookups, that can really
slow things down.
Regards,
Dianne.
#!/usr/bin/perl
#### ns.pl test program
use Net::DNS;
use Net::DNS::Resolver;
my $r = Net::DNS::Resolver->new(nameservers => ['10.50.100.100', '192.168.10.23']);
my $x = $r->query('colo3.roaringpenguin.com', 'A');
-------------------------------------------------------------------------
strace output:
$ strace -t -esendto perl ns.pl
10:03:49 sendto(4, "N\341\1\0\0\1\0\0\0\0\0\0\5colo3\16roaringpengui"..., 42, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.50.100.100")}, 16) = 42
10:03:59 sendto(4, "N\341\1\0\0\1\0\0\0\0\0\0\5colo3\16roaringpengui"..., 42, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.10.23")}, 16) = 42
10:03:59 +++ exited with 0 +++
More information about the MIMEDefang
mailing list