Step 1: Use Alibaba Cloud's yum source to install the software on Centos. If an error message appears as shown in the figure, it is found that the domain name cannot be resolved. The same is true for manually testing the Baidu domain name. Check the domain name configuration and find that Linux There is no DNS resolution configured on
Step 2: The methods of setting DNS under CentOS 7 and CentOS 6 are different, use a new command line Tool nmcli to set up
nmcli connection show------Display the current network connection
(Recommended tutorial: centos usage tutorial)
Step 3: Modify the DNS server corresponding to the current network connection. The network connection here can be identified by name or UUID (eth0 is the external network card)
nmcli con mod eth0 ipv4.dns "114.114.114.114 8.8.8.8"
Step 4: nmcli con up eth0---------Enable dns configuration to take effect
View The /etc/resolv.conf configuration has also been updated
Step 5: Use the www.baidu.com domain name to test and find that it has been parsed normally and the software has been installed successfully
Recommended related video tutorials: linux video tutorial
The above is the detailed content of How to configure dns domain name resolution in centos. For more information, please follow other related articles on the PHP Chinese website!