CentOS网络设置 couldn't resolve host 'mirrorlist.centos.org问题解决

yum命令安装软件时,出现一堆的”couldn't resolve host 'mirrorlist.centos.org”这个问题。

        上网上查了半天,很多都说在/etc/resolv.conf文件末尾添加下边这几段

 

[plain] ​​view plain​​​ ​​copy​​


1. nameserver 8.8.8.8
2. nameserver 8.8.4.4
3. serchdomain localdomain

 

问题根本原因就是你的CentOS不能连接网络造成的。。。

yum命令安装软件时,出现--centos 7 安装apache 出现 Could not resolve host: mirrorlist.centos.org; 未知的错误_百度

你要问我为什么是“百度”?我只能回答:百度当然是用来测试网络通不通用的。。。

好吧言归正传。我也是醉了。。。最近弄虚拟机都是搞得固定IP小局域网的模式,根本上不了外网。我竟然忘了!!

 

        最后果断切换虚机网卡配置,链接上外网:

yum命令安装软件时,出现--centos 7 安装apache 出现 Could not resolve host: mirrorlist.centos.org; 未知的错误_百度_02

 

        然后再用yum命令更新。。。果断好使了。。。

yum命令安装软件时,出现--centos 7 安装apache 出现 Could not resolve host: mirrorlist.centos.org; 未知的错误_外网_03


龙腾一族至尊龙骑