+ -
当前位置:首页 → 问答吧 → lfs 网络问题

lfs 网络问题

时间:2009-12-25

来源:互联网

我这边出现了两个情况:

1)LFS6.5:连网关都PING不能,但可以ping通局域网内的其它PC
root:~# cat /etc/sysconfig/network-devices/ifconfig.eth0/ipv4
ONBOOT=yes
SERVICE=ipv4-static
IP=192.168.2.237
GATEWAY=192.168.2.202
PREFIX=24
BROADCAST=192.168.2.255
root:~# route add default gw 192.168.2.202
SIOCADDRT: File exists
root:~# ip route
192.168.2.0/24 dev eth0 proto kernel scope link src 192.168.2.237
default via 192.168.2.202 dev eth0

2)LFS6.3:能ping通IP地址,但无法解析域名
root:~# cat /etc/resolv.conf
nameserver 210.21.4.130
nameserver 61.144.56.100
root:~# cat /etc/nsswitch.conf
#Begin /etc/nsswitch.conf
passwd: files
group: files
shadow: files
hosts: files dns
networks: files
protocols: files
services: files
ethers: files
rpc: files
#End /etc/nsswitch.conf
root:~# ls -l /lib/lib*dns*
-rwxr-xr-x 1 root root 21038 2002-01-25 /lib/libnss_dns-2.5.1.so
lrwxrwxrwx 1 root root 19 2009-06-29 /lib/libnss_dns.so.2 -> libnss_dns-2.5.1.so

各位请赐教,谢谢!

作者: paraller   发布时间: 2009-12-25

引用:
作者: paraller
1)LFS6.5:连网关都PING不能,但可以ping通局域网内的其它PC
网关跟其它PC对 lfs6.5这台计算机有区别吗?
应该是物理问题。

作者: 飞龙在天   发布时间: 2009-12-25

引用:
作者: paraller
我这边出现了两个情况:
2)LFS6.3:能ping通IP地址,但无法解析域名
root:~# cat /etc/resolv.conf
nameserver 210.21.4.130
nameserver 61.144.56.100
DNS的问题
用Google的DNS服务器看看
8.8.8.8
8.8.4.4

作者: 飞龙在天   发布时间: 2009-12-25

引用:
作者: 飞龙在天
网关跟其它PC对 lfs6.5这台计算机有区别吗?
应该是物理问题。
网关与其它PC的是一样的,而且我换了在网络正常的机子上,情况也一样.所以应该不是物理问题吧

作者: paraller   发布时间: 2009-12-25

引用:
作者: 飞龙在天
DNS的问题
用Google的DNS服务器看看
8.8.8.8
8.8.4.4
我换了这个DNS真的就可以了,但是210.21.4.130在其它的LINUX系统与Windows系统上都能正常使用呀,这是为什么?

作者: paraller   发布时间: 2009-12-25

引用:
作者: paraller
我换了这个DNS真的就可以了,但是210.21.4.130在其它的LINUX系统与Windows系统上都能正常使用呀,这是为什么?
如果把 nameserver 的兩行去掉,情況又如何?

作者: d00m3d   发布时间: 2009-12-26

引用:
作者: d00m3d
如果把 nameserver 的兩行去掉,情況又如何?
如果去了nameserver,能ping通主机IP,但还是无法解析域名.
没有设置DNS,无法解析域名而能PING主机就很正常

作者: paraller   发布时间: 2009-12-26

This means you can access internet via the gateway but you have to define the DNS servers by yourself.

I used to use OpenDNS but I also switched to Google Public DNS recently. It just helps surfing the internet faster.

作者: d00m3d   发布时间: 2009-12-26

引用:
作者: d00m3d
This means you can access internet via the gateway but you have to define the DNS servers by yourself.

I used to use OpenDNS but I also switched to Google Public DNS recently. It just helps surfing the internet faster.
Thanks for your reply.
嗯,这个情况我知道.因为我将http://www.baidu.com写入/etc/hosts文件,能也仅能解析baidu的域名.
我想知道为什么该DNS在别的机子上能正常工作而这一台不行,系统完全一样,同一个交换机.

PS:Google Public DNS比 OpenDNS真的要快么?我无意中看到这篇文章,但我没自己做测试.仅供参考^_^
http://www.chinaz.com/Webbiz/Exp/120Q004532009.html

作者: paraller   发布时间: 2009-12-28

引用:
作者: paraller
Thanks for your reply.
嗯,这个情况我知道.因为我将http://www.baidu.com写入/etc/hosts文件,能也仅能解析baidu的域名.
我想知道为什么该DNS在别的机子上能正常工作而这一台不行,系统完全一样,同一个交换机.

PS:Google Public DNS比 OpenDNS真的要快么?我无意中看到这篇文章,但我没自己做测试.仅供参考^_^
http://www.chinaz.com/Webbiz/Exp/120Q004532009.html
I hate to run test with software because I cannot judge if it is cheating.

If you wanna compare surfing speed, try to run few tests here:

http://speedtest.net/

Comparing results with several servers arround the world, then you will know the answer.

作者: d00m3d   发布时间: 2010-01-14