Domain Name Cannot Be Resolved (CentOS 6.x system)

Last Updated At: 2025-10-21 09:10:00

Phenomenon Description

After restarting the CVM with the operating system CentOS 6.x or performing the command service network restart, the CVM is unable to resolve domain names.
At the same time, check the /etc/resolv.conf configuration file, it was found that the DNS information was cleared.

Possible Reasons

In CentOS 6.x operating systems, the initscripts versions earlier than 9.03.49-1 have defects due to different grep versions.

Ideas

Upgrade the initscripts to the latest version and regenerate the DNS information.

Processing Procedures

  1. Log in to the CVM.

  2. Perform the following command to check the version of initscripts and confirm whether the initscripts have defects due to a version lower than 9.03.49-1.

    rpm -q initscripts
    

Information resembles the following is returned:

initscripts-9.03.40-2.e16.centos.x86_64

It can be seen that the initscripts version initscripts-9.03.40-2 is lower than the problematic version (initscripts-9.03.49-1), and there are risks of DNS being cleared.
3. Perform the following command in sequence to upgrade initscripts to the latest version and regenerate DNS information.

yum makecache
yum -y update initscripts
service network restart
  1. After the upgrade is complete, perform the following command to check the version information of initscripts and confirm whether the upgrade is successful.

    rpm -q initscripts
    

Information resembles the following is returned:

initscripts-9.03.58-1.el6.centos.2.x86_64

It can be seen that the displayed version is different from the previous version and is higher than initscripts-9.03.49-1, and the upgrade operation is successful.