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

kaimi dishui at gmail.com
Tue Dec 19 06:49:45 UTC 2006


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/busybox/attachments/20061219/d69ad17e/attachment-0001.htm 


More information about the busybox mailing list