【异常】阿里云ECS之Centos7下载文件出现”wget: unable to resolve host address”

时间:2022-09-03 21:26:02
[root@iz2ze8w7169ei61c5c1il5z yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
--2017-06-07 21:35:07-- http://mirrors.aliyun.com/repo/Centos-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... failed: Name or service not known.
wget: unable to resolve host address ‘mirrors.aliyun.com

下载yum镜像的时候出现wget失灵的情况,
wget默认安装的
分析是DNS的问题
解决办法:

vi /etc/resolv.conf
添加如下内容(默认里面什么都没有)

nameserver 8.8.8.8
nameserver 8.8.4.4

OK