[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#343140: libc6: resolver always checks search list in /etc/resolv.conf



Package: libc6
Version: 2.3.2.ds1-22
Severity: important

I originally posted a bug report for postfix detailing the problem but I
can reproduce the bug outside of postfix.  Here's the postfix bug
report in case you're interested:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=314891

In a nutshell, when using 'search' lines in /etc/resolv.conf, the
resolver always appends listed search domains to a hostname lookup even
when the host being searched is fully-qualified (contains one or more dots).
This results in a LOT of needless DNS traffic.  On a busy mail server,
it makes using the 'search' lines extremely expensive (because DNS traffic
increases exponentially).

Here's an strace of 'telnet mx1.hotmail.com 25'.  Oddly, it seems to do
the right thing initially but the fully-qualified lookup must always
fail, resulting in subsequent lookups using the search list.

$ cat /etc/resolv.conf
nameserver 69.51.81.36
nameserver 69.51.78.68
search ul.aspextra.net aspextra.net

$ strace telnet mx1.hotmail.com 25
...
open("/etc/resolv.conf", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=274, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40018000
read(3, "# Dynamic resolv.conf(5) file fo"..., 4096) = 274
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x40018000, 4096)                = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("69.51.81.36")}, 28) = 0
send(3, "\n\177\1\0\0\1\0\0\0\0\0\0\3mx1\7hotmail\3com\0\0\34\0"..., 33, 0) = 33
gettimeofday({1134449292, 353764}, NULL) = 0
poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 5000) = 1
ioctl(3, FIONREAD, [98])                = 0
recvfrom(3, "\n\177\201\200\0\1\0\0\0\1\0\0\3mx1\7hotmail\3com\0\0\34"..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("69.51.81.36")}, [16]) = 98
close(3)                                = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("69.51.81.36")}, 28) = 0
send(3, "\n\200\1\0\0\1\0\0\0\0\0\0\3mx1\7hotmail\3com\2ul\10"..., 49, 0) = 49
gettimeofday({1134449292, 357407}, NULL) = 0
poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 5000) = 1
ioctl(3, FIONREAD, [49])                = 0
recvfrom(3, "\n\200\201\205\0\1\0\0\0\0\0\0\3mx1\7hotmail\3com\2ul\10"..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("69.51.81.36")}, [16]) = 49
close(3)                                = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("69.51.78.68")}, 28) = 0
send(3, "\n\200\1\0\0\1\0\0\0\0\0\0\3mx1\7hotmail\3com\2ul\10"..., 49, 0) = 49
gettimeofday({1134449292, 361191}, NULL) = 0
poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 3000) = 1
ioctl(3, FIONREAD, [100])               = 0
recvfrom(3, "\n\200\201\203\0\1\0\0\0\1\0\0\3mx1\7hotmail\3com\2ul\10"..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("69.51.78.68")}, [16]) = 100
close(3)                                = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("69.51.81.36")}, 28) = 0
send(3, "\n\201\1\0\0\1\0\0\0\0\0\0\3mx1\7hotmail\3com\10asp"..., 46, 0) = 46
gettimeofday({1134449292, 364427}, NULL) = 0
poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 5000) = 1
ioctl(3, FIONREAD, [97])                = 0
recvfrom(3, "\n\201\201\203\0\1\0\0\0\1\0\0\3mx1\7hotmail\3com\10as"..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("69.51.81.36")}, [16]) = 97
close(3)                                = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("69.51.81.36")}, 28) = 0
send(3, "\n\202\1\0\0\1\0\0\0\0\0\0\3mx1\7hotmail\3com\0\0\1\0"..., 33, 0) = 33
gettimeofday({1134449292, 367710}, NULL) = 0
poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 5000) = 1
ioctl(3, FIONREAD, [195])               = 0
recvfrom(3, "\n\202\201\200\0\1\0\4\0\5\0\0\3mx1\7hotmail\3com\0\0\1"..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("69.51.81.36")}, [16]) = 195
close(3)                                = 0
socket(PF_FILE, SOCK_STREAM, 0)         = 3
connect(3, {sa_family=AF_FILE, path="/var/run/.nscd_socket"}, 110) = -1 ENOENT (No such file or directory)
close(3)                                = 0
gettimeofday({1134449292, 371589}, NULL) = 0
getpid()                                = 15269
open("/etc/resolv.conf", O_RDONLY)      = 3
...


-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.8-2-686-smp
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages libc6 depends on:
ii  libdb1-compat                 2.1.3-7    The Berkeley database routines [gl

-- no debconf information



Reply to: