For system, network and cloud administrators

How to fix “Could not resolve host: mirrorlist.centos.org; Unknown error”

This can happen after a fresh installation of CentOS. The /etc/resolv.conf is looking for a DNS that it can use but after a fresh installation, it usually comes empty. So, if the file has no DNS to look after, then it can not resolve hostnames. This should tell you that the current machine is using the wrong DNS server.

So, there are 2 ways you can fix this:

  1. You check your main/local router’s DNS settings.
  2. You manually add a DNS server to your current host by:
  • editing /etc/resolv.conf and adding the following line:
nameserver 8.8.8.8
  • updating the repositories, again:
sudo yum update -y

Leave a Reply

Your email address will not be published. Required fields are marked *