Howto fix couldn’t resolve host on Centos Redhat RHEL Fedora

Howto fix couldn’t resolve host on Centos Redhat RHEL Fedora

linux

 

 

 

1. Error you are getting:

[root@localhost ~]# yum install wget
Loaded plugins: fastestmirror
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=i386&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.

2. How to fix that. The problem is we don’t have DNS Server to resolve the name or DNS Server is died.

[root@localhost ~]# vi /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
[root@localhost ~]#

3.  Result

[root@localhost ~]# yum install wget
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.as29550.net
* extras: mirror.mhd.uk.as44574.net
* updates: mirrors.coreix.net
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package wget.i686 0:1.12-1.8.el6 will be installed
–> Finished Dependency ResolutionDependencies Resolved=====================================================================================================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================================================================================================
Installing:
wget i686 1.12-1.8.el6 base 481 kTransaction Summary
=====================================================================================================================================================================================================
Install 1 Package(s)Total size: 481 k
Installed size: 1.8 M
Is this ok [y/N]: y
Downloading Packages:
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid : CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>
Package: centos-release-6-3.el6.centos.9.i686 (@anaconda-CentOS-201207051201.i386/6.3)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : wget-1.12-1.8.el6.i686 1/1
Verifying : wget-1.12-1.8.el6.i686 1/1

Installed:
wget.i686 0:1.12-1.8.el6

Complete!

That’s all. Thanks for using IThelpblog.com.

 

 

4 comments to Howto fix couldn’t resolve host on Centos Redhat RHEL Fedora

  • Hakoo  says:

    Hello,
    I have tried your step. But still its not working, these is what I am getting :

    [root@hosting ~]# yum install wget

    Loaded plugins: fastestmirror, security
    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
    [root@hosting ~]#

    Can you help me with these?

    • Kevin  says:

      Can you send me your dns setting ?
      cat /etc/resolv.conf
      Regards,
      Kevin

  • pmac95  says:

    Hi Kevin I’m having similar error messages as Hakoo. i.e.
    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 , here the output of resolve.conf

    nameserver 8.8.8.8
    nameserver 8.8.4.4

    It was empty after I installed Centos 6.4 vo I followed your instructions above to create the DNS Server.
    Any morehelp would be appreciated.
    Thanks
    Pmac95

    • Kevin  says:

      Hi Pmac95,

      Can you try to open terminal, type 3 commands and send me the results:

      1. /etc/init.d/iptables stop
      2. ping mirrorlist.centos.org
      3. ping 8.8.8.8

      Regards,
      Kevin

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>