This usually happens when the server can’t connect to the Internet because of can’t resolve to name server.

Solution

Take a look at /etc/resolv.conf file. I had following Keep “search localdomain” at the bottom, so something like below Save the file and try to perform yum. It was all good for me. Note: nameserver may differ as shown in the example above. The point here is to keep localhost at the bottom and things should move. Interested in learning about Linux administration?

Could not resolve host  mirrorlist centos org  No address associated with hostname  - 38Could not resolve host  mirrorlist centos org  No address associated with hostname  - 29Could not resolve host  mirrorlist centos org  No address associated with hostname  - 66Could not resolve host  mirrorlist centos org  No address associated with hostname  - 62Could not resolve host  mirrorlist centos org  No address associated with hostname  - 88Could not resolve host  mirrorlist centos org  No address associated with hostname  - 89Could not resolve host  mirrorlist centos org  No address associated with hostname  - 21Could not resolve host  mirrorlist centos org  No address associated with hostname  - 40Could not resolve host  mirrorlist centos org  No address associated with hostname  - 86Could not resolve host  mirrorlist centos org  No address associated with hostname  - 62Could not resolve host  mirrorlist centos org  No address associated with hostname  - 30Could not resolve host  mirrorlist centos org  No address associated with hostname  - 36Could not resolve host  mirrorlist centos org  No address associated with hostname  - 42Could not resolve host  mirrorlist centos org  No address associated with hostname  - 4Could not resolve host  mirrorlist centos org  No address associated with hostname  - 77Could not resolve host  mirrorlist centos org  No address associated with hostname  - 24Could not resolve host  mirrorlist centos org  No address associated with hostname  - 54Could not resolve host  mirrorlist centos org  No address associated with hostname  - 26Could not resolve host  mirrorlist centos org  No address associated with hostname  - 25Could not resolve host  mirrorlist centos org  No address associated with hostname  - 34Could not resolve host  mirrorlist centos org  No address associated with hostname  - 75Could not resolve host  mirrorlist centos org  No address associated with hostname  - 56Could not resolve host  mirrorlist centos org  No address associated with hostname  - 72