[BusyBox] nslookup always use default server
magicfox
magicfox at magic.fr
Mon Nov 15 12:50:05 UTC 2004
Busybox: 1.0
uClibc: 0.9.26
/* nslookup not use full qualified name server */
/* may be to put on TODO list (gnu nslookup handle this) */
/ # nslookup codepoet.org ns.codepoet.org
Server: localhost
Address: 127.0.0.1
Name: codepoet.org
Address: 166.70.99.138
/* but nslookup use address */
/ # nslookup codepoet.org 166.70.99.138
Server: codepoet.org
Address: 166.70.99.138
Name: codepoet.org
Address: 166.70.99.138
It seems correct but in fact strace still show the usage of the default
name server defined in /etc/resolv.conf
/*
...
open("/etc/hosts", O_RDONLY) = 3
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbffff4c0) = -1 ENOTTY
(Inappropriate ioctl for device)
read(3, "127.0.0.1\tlocalhost\n", 256) = 20
read(3, "", 256) = 0
close(3) = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(53),
sin_addr=inet_addr("127.0.0.1")}, 16) = 0
send(3, "\0\2\1\0\0\1\0\0\0\0\0\0\003138\00299\00270\003166\7in"..., 44,
0) = 44select(4, [3], NULL, NULL, {10, 0}) = 1 (in [3], left {9,
840000})
recv(3, "\0\2\201\200\0\1\0\1\0\3\0\3\003138\00299\00270\003166"...,
512, 0) = 183
close(3) = 0
write(1, "Server: codepoet.org\n", 25Server: codepoet.org
) = 25
write(1, "Address: 166.70.99.138\n", 26Address: 166.70.99.138
) = 26
write(1, "\n", 1
) = 1
open("/etc/hosts", O_RDONLY) = 3
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbffff4f8) = -1 ENOTTY
(Inappropriate ioctl for device)
read(3, "127.0.0.1\tlocalhost\n", 256) = 20
read(3, "", 256) = 0
close(3) = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(53),
sin_addr=inet_addr("127.0.0.1")}, 16) = 0
send(3, "\0\3\1\0\0\1\0\0\0\0\0\0\10codepoet\3org\0\0\1\0\1", 30, 0) = 30
select(4, [3], NULL, NULL, {10, 0}) = 1 (in [3], left {10, 0})
recv(3, "\0\3\201\200\0\1\0\1\0\2\0\2\10codepoet\3org\0\0\1\0\1"...,
512, 0) = 114
close(3) = 0
write(1, "Name: codepoet.org\n", 25Name: codepoet.org
) = 25
write(1, "Address: 166.70.99.138\n", 26Address: 166.70.99.138
) = 26
_exit(0) = ?
*/
I looked at the achives and I saw an old unanswered mail from Tobias
reporting that it was a uClibc issue.
http://busybox.net/lists/uclibc/2003-August/006741.html.
It seems true, the same applet compiled against glibc report the correct
usage of the defined name server.
The definition of nameserver in _res.nsaddr_list[0] seems ignored.
More information about the busybox
mailing list