I just faced this problem so I thought I'd add what fixed it for me since the resolution was pretty simple. For me, I was overlooking the fact that whenever I changed my hostname, it was wiping out everything in /etc/resolv.conf so I:
nano -w /etc/resolv.conf
**
added the following lines:
nameserver 8.8.8.8
nameserver 8.8.4.4
- Test it (e.g.
yum update -y
)
**note: I used nano in example, simply swap the nano
portion for your own text editor of choice