美文网首页
Name or service not known问题解决

Name or service not known问题解决

作者: chuan_bai | 来源:发表于2020-04-28 17:21 被阅读0次

问题描述:

一个新装的centos 系统,想用yum下载软件提示错误

Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
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; Unknown error"

怀疑是DNS配置的问题,于是ping了百度发现果然 ping不通

ping www.baidu.com
ping: www.baidu.com: Name or service not known

问题解决:

用vim打开文件 resolv.conf

vim /etc/resolv.conf

在其中增加DNS配置

nameserver 8.8.8.8
nameserver 114.114.114.114

相关文章

网友评论

      本文标题:Name or service not known问题解决

      本文链接:https://www.haomeiwen.com/subject/ejdbwhtx.html