Troubleshooting: Why mirrorlist.centos.org Domain Resolution Fails and How to Fix It


2 views

When working with CentOS repositories, you might encounter a situation where mirrorlist.centos.org fails to resolve while centos.org works perfectly. This manifests through tools like nslookup and dig returning NXDOMAIN responses.

From the diagnostic output provided, we can see:

nslookup mirrorlist.centos.org
Server:         1.1.1.1
Address:        1.1.1.1#53

** server can't find mirrorlist.centos.org: NXDOMAIN

The SOA record from the dig output shows:

;; AUTHORITY SECTION:
centos.org.             2795    IN      SOA     ns1.centos.org. hostmaster.centos.org. 2024070102 28800 7200 2400000 3600

Here are some technical solutions to consider:

1. Direct Repository Configuration

Instead of relying on mirrorlist, directly specify a known working mirror in your repo file:

[base]
name=CentOS-$releasever - Base
baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

2. Alternative DNS Resolution

Try using different DNS servers:

sudo bash -c 'echo "nameserver 8.8.4.4" >> /etc/resolv.conf'
sudo systemctl restart NetworkManager

3. Checking for DNS Propagation

Sometimes this could be a temporary DNS propagation issue. Check across different DNS providers:

dig @1.1.1.1 mirrorlist.centos.org
dig @8.8.8.8 mirrorlist.centos.org
dig @208.67.222.222 mirrorlist.centos.org

For production systems, consider:

  • Setting up local DNS caching with unbound or dnsmasq
  • Using specific mirror URLs instead of mirrorlist in your repo configurations
  • Implementing a failover mechanism in your configuration management

After implementing changes, verify with:

yum clean all
yum makecache
yum repolist

The domain mirrorlist.centos.org appears to be experiencing DNS resolution failures, as confirmed by multiple diagnostic tools. This affects package management operations for CentOS/RHEL systems that rely on this endpoint for repository mirror selection.

# Basic DNS checks
$ dig mirrorlist.centos.org +short
# No output indicates resolution failure

$ host mirrorlist.centos.org
Host mirrorlist.centos.org not found: 3(NXDOMAIN)

# Alternative DNS servers test
$ dig @8.8.8.8 mirrorlist.centos.org
; <<>> DiG 9.16.1 <<>> @8.8.8.8 mirrorlist.centos.org
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 6491

For systems requiring immediate access to CentOS mirrors, consider these alternatives:

# Temporary solution: Use direct base URL in repo files
sudo sed -i 's/mirrorlist=http:\/\/mirrorlist.centos.org/baseurl=http:\/\/mirror.centos.org/' /etc/yum.repos.d/CentOS-*.repo

# Alternative using vault.centos.org (for EOL versions)
sudo curl -o /etc/yum.repos.d/CentOS-Base.repo \ 
https://vault.centos.org/centos/$releasever/os/x86_64/.treeinfo

Monitor these official channels for updates:

  • CentOS mailing lists (centos-announce@lists.centos.org)
  • Red Hat Status Page (https://status.redhat.com)
  • CentOS IRC: #centos on Libera.Chat

For production environments, implement this Python fallback mechanism:

#!/usr/bin/python3
import subprocess
import requests

def check_mirrorlist():
    try:
        r = requests.get("http://mirrorlist.centos.org", timeout=5)
        return r.status_code == 200
    except:
        return False

if not check_mirrorlist():
    print("Mirrorlist unavailable - activating fallback")
    subprocess.run(["sudo", "sed", "-i", 
                   "s/^mirrorlist/#mirrorlist/g", 
                   "/etc/yum.repos.d/CentOS-*.repo"])
    subprocess.run(["sudo", "sed", "-i",
                   "s/^#baseurl/baseurl/g",
                   "/etc/yum.repos.d/CentOS-*.repo"])

For enterprise environments, consider setting up:

  1. Local mirror using reposync
  2. Red Hat Satellite server
  3. Pulp repository manager