Solve Couldn't resolve host 'into list .centos.org
The following error is reported when you install software through yum in linux today:
[root@multi-mysqlyum.repos.d]
#yuminstallncursesdevel-y
Loadedplugins:fastestmirror,security
Loadingmirrorspeedsfromcachedhostfile
Couldnotretrievemirrorlisthttp:
//mirrorlist
.centos.org/?release=6&arch=x86_64&repo=oserrorwas
14:PYCURLERROR6-
"Couldn'tresolvehost'mirrorlist.centos.org'"
Error:Cannot
find
avalidbaseurl
for
repo:base
Literally, the list.centos.org address cannot be resolved. It should be related to the dns Network configuration. The final solution is to add the IP address of the DNS server in the DNS domain name resolution configuration file:
[root@multi-mysql~]
#vim/etc/resolv.conf
nameserver8.8.8.8
nameserver202.106.0.20
Restart NETWORK SERVICE
[root@multi-mysql~]
#/etc/init.d/networkrestart
Shuttingdowninterfaceeth0:[OK]
Shuttingdownloopbackinterface:[OK]
Bringinguploopbackinterface:[OK]
Bringingupinterfaceeth0:Determining
if
ipaddress192.168.1.202isalready
in
use
for
deviceeth0...
[OK]
Install yum again. Normal
[root@multi-mysql~]
#yuminstallnmap-y
Loadedplugins:fastestmirror,security
Loadingmirrorspeedsfromcachedhostfile
*base:mirrors.yun-idc.com
*extras:mirrors.yun-idc.com
*updates:mirrors.yun-idc.com
base|3.7kB00:00
base
/primary_db
|4.6MB00:01
extras|3.4kB00:00
extras
/primary_db
|33kB00:00
updates|3.4kB00:00
updates
/primary_db
|2.6MB00:00
SettingupInstallProcess
ResolvingDependencies
-->Runningtransactioncheck
--->Packagenmap.x86_642:5.51-4.el6willbeinstalled
-->FinishedDependencyResolution
... This is omitted