Linux不能上网ping:unknown host问题怎么解决?

问题:ping 百度没法ping通,提示unknown hostspa

[root@localhost ~]# ping www.baidu.com
ping: unknown host www.baidu.com.net

 

解决:rest

修改resolv.conf,增长两个dns地址(我增长的是合肥的),修改前须要锁定文件server

[root@localhost ~]# vi /etc/resolv.conf
# Generated by NetworkManagerdns


# 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
nameserver 202.102.192.68
nameserver 202.102.199.68
ip


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

[root@localhost ~]# chattr +i /etc/resolv.conf百度

保存后重启网卡
[root@localhost ~]# service NetworkManager restartfile

若是要从新编辑须要先解除锁定:
[root@localhost ~]# chattr -i /etc/resolv.confnetwork

 

----------

其余命令: [root@localhost ~]# ifconfig -a [root@localhost ~]# cat  /etc/sysconfig/network-scripts/ifcfg-eth0

相关文章
相关标签/搜索