yum报:[Errno 14] curl#6 - “Could not resolve host: mirrors.cqu.edu.cn;Unknown error“未知的错误,正在尝试其他镜像类错误

报错信息:

[root@localhost ~]# yum install bind bind-utils.x86_64 -y
已加载插件:fastestmirror, langpacks
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误"
http://mirrors.tuna.tsinghua.edu.cn/centos/7.9.2009/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.tuna.tsinghua.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.njupt.edu.cn/centos/7.9.2009/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.njupt.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.dgut.edu.cn/centos/7.9.2009/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.dgut.edu.cn; 未知的错误"
正在尝试其它镜像。
http://ftp.sjtu.edu.cn/centos/7.9.2009/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: ftp.sjtu.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.cqu.edu.cn/CentOS/7.9.2009/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.cqu.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.neusoft.edu.cn/centos/7.9.2009/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.neusoft.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.163.com/centos/7.9.2009/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.163.com; 未知的错误"
正在尝试其它镜像。
http://mirrors.cn99.com/centos/7.9.2009/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.cn99.com; 未知的错误"
正在尝试其它镜像。
http://mirrors.bfsu.edu.cn/centos/7.9.2009/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.bfsu.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.aliyun.com/centos/7.9.2009/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.aliyun.com; 未知的错误"
正在尝试其它镜像。
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=extras&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误"
http://mirror.lzu.edu.cn/centos/7.9.2009/extras/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirror.lzu.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.ustc.edu.cn/centos/7.9.2009/extras/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.ustc.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.tuna.tsinghua.edu.cn/centos/7.9.2009/extras/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.tuna.tsinghua.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.dgut.edu.cn/centos/7.9.2009/extras/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.dgut.edu.cn; 未知的错误"
正在尝试其它镜像。
http://ftp.sjtu.edu.cn/centos/7.9.2009/extras/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: ftp.sjtu.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.cqu.edu.cn/CentOS/7.9.2009/extras/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.cqu.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.neusoft.edu.cn/centos/7.9.2009/extras/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.neusoft.edu.cn; 未知的错误"
正在尝试其它镜像。
.......

解决方法:

上面的报错是因为没有加相应的DNS:

[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens33
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.59.131
NETMASK=255.255.255.0
GATEWAY=192.168.59.2
DNS=8.8.8.8

[root@localhost ~]# vim /etc/resolv.conf 
# Generated by NetworkManager
nameserver 8.8.8.8     //这里的dns要对应上述ens33中的DNS

[root@localhost ~]# yum install bind bind-utils.x86_64 -y

 

  • 9
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值