what's the prerequisite of network? I can not nslookup and ping a domain name

kaimi dishui at gmail.com
Wed Dec 20 03:23:54 UTC 2006


On 12/20/06, Denis Vlasenko <vda.linux at googlemail.com> wrote:
>
> On Tuesday 19 December 2006 07:49, kaimi wrote:
> > hi,all
> >
> > I have actived eth0, and set the ipaddr and gateway, as well as
> > /etc/resolv.conf. I can ping my gateway, as well as the ipaddr of
> > www.google.com, while it failed if "ping www.google.com", it seems like
> the
> > nameserver can not translate the domain name to ipaddr, I'm sure the
> > nameserver is right. I digged the source in nslookup.c, I found that
> > gethostbyname() or gethostbyaddr() return NULL. any ideas???
> >
> > /etc # cat hosts
> > 127.0.0.1 localhost
> > /etc # cat resolv.conf
> > nameserver 221.10.251.197
> > /etc # route
> > Kernel IP routing table
> > Destination     Gateway         Genmask         Flags Metric Ref    Use
> > Iface
> > 192.168.0.0     *               255.255.255.0   U     0      0        0
> eth0
> > 192.168.0.0     *               255.255.255.0   U     0      0        0
> eth0
> > default         192.168.0.1     0.0.0.0         UG    0      0        0
> eth0
> > /etc # ifconfig
> > eth0      Link encap:Ethernet  HWaddr 08:00:3E:26:0A:5B
> >           inet addr:192.168.0.254  Bcast:192.168.0.255  Mask:
> 255.255.255.0
> >           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
> >           RX packets:1923 errors:0 dropped:0 overruns:0 frame:0
> >           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
> >           collisions:0 txqueuelen:1000
> >           RX bytes:192898 (188.3 KiB)  TX bytes:0 (0.0 B)
> >           Interrupt:53 Base address:0x300
> >
> > lo        Link encap:Local Loopback
> >           inet addr:127.0.0.1  Mask:255.0.0.0
> >           UP LOOPBACK RUNNING  MTU:16436  Metric:1
> >           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> >           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
> >           collisions:0 txqueuelen:0
> >           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
> > /etc # ping 192.168.0.1(gateway)
> > PING 192.168.0.1 (192.168.0.1): 56 data bytes
> > 84 bytes from 192.168.0.1: icmp_seq=0 ttl=64 time=6.1 ms
> > 84 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=0.7 ms
> > /etc # ping www.google.com
> > ping: www.google.com: Unknown server error
> > /etc # ping 66.249.89.99(ipaddr of www.google.com)
> > PING 66.249.89.99 (66.249.89.99): 56 data bytes
> > 64 bytes from 66.249.89.99: icmp_seq=0 ttl=241 time=97.7 ms
> > /etc # ping 221.10.251.197(dns1)
> > PING 221.10.251.197 (221.10.251.197): 56 data bytes
> > 84 bytes from 221.10.251.197: icmp_seq=0 ttl=55 time=2.8 ms
> >
> > thanks for your help
> > kaimi
>
> Can you obtain the "tcpdump -nlieth0 -vvv -s0 port 53" output?
> --
> vda
> >
>
/ # tcpdump -nlieth0 -vvv -s0 port 53
device eth0 entered promiscuous mode

tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535
bytes
00:02:13.811975 IP (tos 0x0, ttl 128, id 19642, offset 0, flags [none],
proto: UDP (17), length: 62) 192.168.0.22.1692 > 202.106.0.20.53: [udp sum
ok]  47725+ A? jczs.sina.com.cn. (34)
00:02:14.817461 IP (tos 0x0, ttl 128, id 19763, offset 0, flags [none],
proto: UDP (17), length: 62) 192.168.0.22.1692 > 221.10.251.196.53: [udp sum
ok]  47725+ A? jczs.sina.com.cn. (34)
00:02:14.905366 IP (tos 0x0, ttl  52, id 13674, offset 0, flags [DF], proto:
UDP (17), length: 170) 221.10.251.196.53 > 192.168.0.22.1692: [udp sum ok]
47725 q: A? jczs.sina.com.cn. 2/3/1 jczs.sina.com.cn. CNAME
jupiter.sina.com.cn., jupiter.sina.com.cn. A 202.108.33.21 ns: sina.com.cn.
NS ns1.sina.com.cn., sina.com.cn. NS ns2.sina.com.cn., sina.com.cn. NS
ns3.sina.com.cn. ar: ns1.sina.com.cn. A 202.106.184.166 (142)
00:02:57.164352 IP (tos 0x0, ttl 128, id 25337, offset 0, flags [none],
proto: UDP (17), length: 71) 192.168.0.22.2000 > 202.106.0.20.53: [udp sum
ok]  19308+ A? jczsfans.news.sina.com.cn. (43)
00:02:58.168525 IP (tos 0x0, ttl 128, id 25449, offset 0, flags [none],
proto: UDP (17), length: 71) 192.168.0.22.2000 > 221.10.251.196.53: [udp sum
ok]  19308+ A? jczsfans.news.sina.com.cn. (43)
00:02:58.286186 IP (tos 0x0, ttl  52, id 22545, offset 0, flags [DF], proto:
UDP (17), length: 141) 221.10.251.196.53 > 192.168.0.22.2000: [udp sum ok]
19308 q: A? jczsfans.news.sina.com.cn. 1/3/0 jczsfans.news.sina.com.cn. A
202.108.33.50 ns: sina.com.cn. NS ns3.sina.com.cn., sina.com.cn. NS
ns1.sina.com.cn., sina.com.cn. NS ns2.sina.com.cn. (113)
00:02:59.216409 IP (tos 0x0, ttl 128, id 25880, offset 0, flags [none],
proto: UDP (17), length: 69) 192.168.0.22.2033 > 202.106.0.20.53: [udp sum
ok]  46188+ A? cache.orion.sina.com.cn. (41)
00:03:00.222629 IP (tos 0x0, ttl 128, id 26254, offset 0, flags [none],
proto: UDP (17), length: 69) 192.168.0.22.2033 > 221.10.251.196.53: [udp sum
ok]  46188+ A? cache.orion.sina.com.cn. (41)
00:03:00.265505 IP (tos 0x0, ttl  52, id 13676, offset 0, flags [DF], proto:
UDP (17), length: 171) 221.10.251.196.53 > 192.168.0.22.2033: [udp sum ok]
46188 q: A? cache.orion.sina.com.cn. 2/3/1 cache.orion.sina.com.cn. A
202.108.33.19, cache.orion.sina.com.cn. A 202.108.35.252 ns: sina.com.cn. NS
ns3.sina.com.cn., sina.com.cn. NS ns1.sina.com.cn., sina.com.cn. NS
ns2.sina.com.cn. ar: ns1.sina.com.cn. A 202.106.184.166 (143)
00:03:08.533216 IP (tos 0x0, ttl 128, id 29604, offset 0, flags [none],
proto: UDP (17), length: 59) 192.168.0.22.2085 > 202.106.0.20.53: [udp sum
ok]  16551+ A? bt.5qzone.net. (31)
00:03:08.576360 IP (tos 0x0, ttl  52, id 47264, offset 0, flags [DF], proto:
UDP (17), length: 75) 202.106.0.20.53 > 192.168.0.22.2085: [udp sum ok]
16551 q: A? bt.5qzone.net. 1/0/0 bt.5qzone.net. A 218.199.111.100 (47)

11 packets captured
14 packets received by filter
0 packets dropped by kernel
device eth0 left promiscuous mo

It seems work, right? but I can not ping out

kaimi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/busybox/attachments/20061220/01f1b12d/attachment-0001.htm 


More information about the busybox mailing list