The solution is as follows:
1. Open the /etc/sysconfig/network-scripts/ifcfg-eth0 configuration file
vim /etc/sysconfig/network-scripts/ifcfg-eth0
(recommended tutorial: centos usage tutorial)
2. Add dns settings
For example:
DNS1=8.8.8.8
Tips: 114.114.114.114 and 8.8.8.8, these two DNS They are all pure, so 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.
Finally restart the network card.
service network restart
Recommended related video tutorials: linux video tutorial
The above is the detailed content of What should I do if the centos system cannot resolve the domain name?. For more information, please follow other related articles on the PHP Chinese website!