Home>Article>Operation and Maintenance> How to configure dns in centos
How to configure dns in centos:
Recommended related video tutorials:linux video tutorial
1. Use new commands Run the tool nmcli to set up
#Display the current network connection
#nmcli connection show NAME UUID TYPE DEVICE eno1 5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 802-3-ethernet eno1
#Modify the DNS server corresponding to the current network connection. The network connection here can be identified by name or UUID
#nmcli con mod eno1 ipv4.dns "114.114.114.114 8.8.8.8"
#Put dns configuration into effect
#nmcli con up eno1
2. Use the traditional method to manually modify /etc/resolv.conf
Modify the /etc/NetworkManager/NetworkManager.conf file and add "dns" to the main section =none” option:
[main] plugins=ifcfg-rh dns=none
NetworkManager reloads the modified configuration
# systemctl restart NetworkManager.service
Manually modify /etc/resolv.conf
nameserver 114.114.114.114 nameserver 8.8.8.8
Recommended tutorial:centos tutorial
The above is the detailed content of How to configure dns in centos. For more information, please follow other related articles on the PHP Chinese website!