阿里云CentOs 6.4 yum报错Couldn’t resolve host’xx
在centOs上安装软件时。提示报错信息:
Loaded plugins: security
http://mirrors.aliyun.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - “Couldn’t resolve host ‘mirrors.aliyun.com’”
Trying other mirror.
http://mirrors.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - “Couldn’t resolve host ‘mirrors.aliyuncs.com’”
Trying other mirror.
原因
dns服务器没有配置正确
解决办法:
打开文件/etc/resolv.conf在其中添加:
nameserver 8.8.8.8
nameserver 8.8.4.4
search localdomain
然后重启网卡:使用命令: service network restart