---
title: "yum 提示找不到镜像的问题：Couldn't resolve host 'mirrorlist.centos.org'  "
author: "ikon"
date: "2014-01-26T14:54:44Z"
tags: []
categories: ["操作系统"]
slug: "yum-couldn-t-resolve-host-mirrorlist-centos-org"
draft: false
lastmod: "2014-01-26T14:54:44Z"
id: 2009558
url: "https://ikon.iteye.com/blog/2009558"
---

**问题：**  
\[root@cddserver2 ~]# yum -y install gcc-*  
Loaded plugins: fastestmirror, presto  
Could not retrieve mirrorlist [http://mirrorlist.centos.org/?release=6&arch=x86\_64&repo=os](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 retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

**原因：**  
 dns服务器没有配置正确

**解决办法：**  
1、打开文件/etc/resolv.conf在其中添加：  
 nameserver 8.8.8.8  
 #nameserver 8.8.4.4  
 #search localdomain

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