Linux学习笔记008---Centos7中Couldn't resolve host 'mirrorlist.centos.org'

JAVA技术交流QQ群:170933152

这个问题,由于本地上不了网:

是因为没有配置dns解析

centos中配置dns解析:

[root@sulei sulei]# yum install docker 
Loaded plugins: fastestmirror 
Loading mirror speeds from cached hostfile 
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was 
14: PYCURL ERROR 6 - “Couldn’t resolve host ‘mirrorlist.centos.org’” 
Error: Cannot find a valid baseurl for repo: base 
解决办法: 
没有配置: 
dns服务器没有配置正确

注意刚用vi 进去以后这个文件中是空的需要自己添加内容

dns的地址可以是能解析域名的服务器就可以

1、打开文件/etc/resolv.conf在其中添加:
 nameserver 8.8.8.8
 nameserver 8.8.4.4
 search localdomain

2、然后重启网卡:使用命令: service network restart

猜你喜欢

转载自blog.csdn.net/lidew521/article/details/81281072
今日推荐