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

Denis Vlasenko vda.linux at googlemail.com
Thu Dec 21 00:53:59 UTC 2006


On Wednesday 20 December 2006 04:23, kaimi wrote:
> 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

> > Can you obtain the "tcpdump -nlieth0 -vvv -s0 port 53" output?

> tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535
> bytes

192.168.0.22.1692 > 202.106.0.20.53: [udp sum ok]  47725+ A? jczs.sina.com.cn. (34)
192.168.0.22.1692 > 221.10.251.196.53: [udp sum ok]  47725+ A? jczs.sina.com.cn. (34)
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)
192.168.0.22.2000 > 202.106.0.20.53: [udp sum ok]  19308+ A? jczsfans.news.sina.com.cn. (43)
192.168.0.22.2000 > 221.10.251.196.53: [udp sum ok]  19308+ A? jczsfans.news.sina.com.cn. (43)
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)
192.168.0.22.2033 > 202.106.0.20.53: [udp sum ok]  46188+ A? cache.orion.sina.com.cn. (41)
192.168.0.22.2033 > 221.10.251.196.53: [udp sum ok]  46188+ A? cache.orion.sina.com.cn. (41)
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)
192.168.0.22.2085 > 202.106.0.20.53: [udp sum ok]  16551+ A? bt.5qzone.net. (31)
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)

It's not your traffic. Your IP is 192.168.0.254, not 192.168.0.22.
Probably you didn't run ping in parallel with tcpdump...

Also note: that another computer uses 221.10.251.196 and 202.106.0.20 as DNS servers,
seems to have success with that.
You are trying to use 221.10.251.197.

--
vda



More information about the busybox mailing list