CentOS DNS解析失败

repo.maven.apache.org: 域名解析暂时失败: Unknown host repo.maven.apache.org: 域名解析暂时失败 -> [Help 1]

CentOS 在配置静态IP时出现解析域名错误:



 1. vi /etc/sysconfig/network-scripts/ifcfg-eth0
[root@develop68 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 
DEVICE=eth0
HWADDR=00:22:15:06:27:18
TYPE=Ethernet
UUID=64e51efe-85c3-493d-87a8-bfa9afbcd565
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
DNS1=8.8.8.8
IPADDR=192.168.2.68
NETMASK=255.255.255.0
GATEWAY=192.168.2.254
设置 DNS1=8.8.8.8 or 8.8.4.4
vi /etc/resolv.conf
nameserver 8.8.4.4
nameserver 8.8.8.8