PING UNKNOWN HOST 在RedHat 5.3上的解决

超级网迷+ 电脑迷+ 音乐迷
打印 被阅读次数

不知道为了什么,google都不让“碰”了:

# ping www.google.com

ping: unknown host www.google.com



有人指点说要看这个文件:

/etc/resolv.conf

打开它看看:

# Generated by NetworkManager

# No nameservers found; try putting DNS servers into your


# ifcfg files in /etc/sysconfig/network-scripts like so:

#

# DNS1=xxx.xxx.xxx.xxx

# DNS2=xxx.xxx.xxx.xxx

# DOMAIN=lab.foo.com bar.foo.com


是个自动生成的文件。按照它的指点到了network-scripts这棵树下。

是ifcfg-eth0,还是ifcfg-lo?

先试第一个: 把网关地址加到后面 “DNS1=192.168.2.1” 。

保存退出。

网络还要重启下:


#ifdown eth0

#ifup eth0

# ping www.google.com

PING www.l.google.com (66.249.80.104) 56(84) bytes of data.

64 bytes from lga15s03-in-f104.1e100.net (66.249.80.104): icmp_seq=1 ttl=57 time=24.5 ms


64 bytes from lga15s03-in-f104.1e100.net (66.249.80.104): icmp_seq=1 ttl=56 time=24.5 ms (DUP!)

64 bytes from lga15s03-in-f104.1e100.net (66.249.80.104): icmp_seq=1 ttl=57 time=25.4 ms (DUP!)

...........................................................

好了!还要找那个resolv.conf核对一下:

# Generated by NetworkManager


nameserver 192.168.2.1

一切正常了!菜鸟也可以睡觉了。。。

登录后才可评论.