报错信息:

[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

 

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐