Home > Article > Operation and Maintenance > What should I do if the domain name cannot be resolved under centos?
Problem:
When I tested crul today, I found that it could not be parsed. Then I tried ping www.baidu.com and it could not be parsed.
Solution:
The first thing that comes to mind is that there may be a problem with the domain name. The solution is as follows:
At the end of /etc/sysconfig/network-scripts/ifcfg-eth0 Plus dns settings.
(Recommended tutorial: centos tutorial)
For example:
DNS1=8.8.8.8
114.114.114.114 and 8.8.8.8, these two DNS are very pure, There is no need to worry about DNS hijacking and other problems caused by ISP operators, and they are all provided to users for free.
114.114.114.114 is the DNS commonly used by China Mobile, China Telecom and China Unicom. 8.8.8.8 is the DNS provided by GOOGLE, and this address is universal.
Then you need to restart the network card. The command is as follows:
service network restart
Of course, my settings are correct, and it can be used after setting this on the previous virtual machine. However, my cloud server still has an error.
Cause: named server does not exist.
Solution:
yum install bind chkconfig named on
Recommended related video tutorials: linux video tutorial
The above is the detailed content of What should I do if the domain name cannot be resolved under centos?. For more information, please follow other related articles on the PHP Chinese website!