YUM安装时出现[Errno 14] PYCURL ERROR 6-"Couldn't resolve host 'mirrors.163.com'"
CentOS 6.2系统使用YUM安装vsftpd时出现如下错误:
#yum install vsftpd
Loaded plugins: aliases, changelog, downloadonly, fastestmirror, kabi, presto, security, tmprepo, verify, versionlock
Loading support for CentOS kernel ABI
Determining fastest mirrors Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was 14: PYCURL ERROR 6 – “Couldn’t resolve host ‘mirrorlist.centos.org’”
…..省略……..
http://mirrors.163.com/centos/6.2/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 – “Couldn’t resolve host ‘mirrors.163.com’”
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
…省略……
查了好多文档都说是dns的问题,但是我的dns设置了3个:
DNS解析也都是正常的,怎么就不对呢
发现是用61.139.2.69解析的,我尝试在/etc/resolve.conf中将第一个dns 119.6.6.6注释掉,然后再用yum命令就恢复正常了:
好奇怪,原来以为YUM更新会逐一尝试每个DNS,现在看来只要/etc/resolve.conf中的第一个DNS不能解析,YUM就不再尝试下一个了。