2

Yum update is not working.I am not able to ping the external networks too

   yum update
   Loaded plugins: fastestmirror, refresh-packagekit, 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


      ping mirrorlist.centos.org
      ping: unknown host mirrorlist.centos.org

2 Answers 2

2

You need to make sure that your DNS settings are correctly configured. This can be done in two ways:

Method 1

  1. Edit the interface configuration, using vi /etc/sysconfig/network-scripts/ifcfg-eth0
  2. Change the settings to those of your network interface, thus change the DNS to suit your DNS.

    DEVICE=eth0
    BOOTPROTO=manual
    ONBOOT=yes
    IPADDR=10.0.1.27
    NETWORK=10.0.1.0
    NETMASK=255.255.255.0
    DNS=8.8.8.8
    

Method 2:

  1. Use vi /etc/sysconfig/network-scripts/ifcfg-eth0.
    Add a new property PEERDNS=no as shown below:

    DEVICE=eth0
    BOOTPROTO=manual
    ONBOOT=yes
    IPADDR=10.0.1.27
    NETWORK=10.0.1.0
    NETMASK=255.255.255.0
    PEERDNS=no
    
  2. Then vi /etc/resolv.conf

    Add DNS server (also referred to as nameserver) to /etc/resolv.conf:

    nameserver 8.8.8.8
    

    Finally, save the changes using :wq.

    Restart the service by typing service network restart.

Also, you might have to run tests to determine whether you are now able to connect to the internet; this can be done by performing ping tests:

  1. Ping the gateway (tests IP and mask settings)
  2. Ping google (tests DNS and default gateway settings)
0

The error message Couldn't resolve host 'mirrorlist.centos.org' points to an issue with name resolution.

Try the command host mirrorlist.centos.org: if it fails, then that is the first problem to solve (check your DNS settings, and whether the machine is able to connect to the internet at all).

3
  • yes ..I m anot able to connect to the internet. host mirrorlist.centos.org ;; connection timed out; trying next origin ;; connection timed out; no servers could be reached
    – knp
    Commented Mar 16, 2015 at 7:00
  • How can can I resolve my DNS settings so that I can reach external network/internet
    – knp
    Commented Mar 16, 2015 at 7:02
  • Can you access internet through your browser?
    – niyasc
    Commented Mar 16, 2015 at 9:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .