In CentOS 7, how does one set the DNS server and centosdns?
In CentOS 7, manually set the DNS in/etc/resolv. conf. After a while, the system will overwrite or clear the DNS. Different from setting DNS in CentOS 6, there are several methods: 1. Use the new command line tool nmcli to set # display the current network connection # nmcli connection showNAME uuid type DEVICEeno1 5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 802-3-ethernet eno1 # modify the DNS server corresponding to the current network, the network connection here can be identified by the name or UUID # nmcli con mod eno1 ipv4.dns "184.108.40.206 220.127.116.11" # apply the dns configuration # nmcli con up eno12, use the traditional method, manually modify/etc/resolv. conf Modify/etc/NetworkManager. conf file. In the main section, add the "dns = none" option: [main] plugins = ifcfg-rhdns = noneNetworkManager to reload the configuration modified above # systemctl restart NetworkManager. service Manual modification/etc/resolv. confnameserver 18.104.22.168nameserver 22.214.171.124
From Weizhi note (Wiz)