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  - 4Could not resolve host  mirrorlist centos org  No address associated with hostname  - 13Could not resolve host  mirrorlist centos org  No address associated with hostname  - 61Could not resolve host  mirrorlist centos org  No address associated with hostname  - 86Could not resolve host  mirrorlist centos org  No address associated with hostname  - 46Could not resolve host  mirrorlist centos org  No address associated with hostname  - 14