In CentOS 7, manually set the DNS in the/etc/resolv.conf, after a while, found to be re-overwritten or removed by the system. Unlike the setup DNS method under CentOS 6, there are several ways: 1. Use the new command-line tool NMCLI to set
#显示当前网络连接 #nmcli Connection showname UUID TYPE DEVICEeno1 5fb06bd0-0bb0-7ffb-45f1 -D6EDD65F3E03 802-3-ethernet eno1# modifies the DNS server that corresponds to the current network connection, where the network connection can be identified by name or UUID #nmcli con mod eno1 ipv4.dns " 114.114.114.114 8.8.8.8 "#将dns配置生效 #nmcli con up eno1
2, the use of traditional methods, manual modification/etc/resolv.conf
[Main]plugins=ifcfg-rhdns=none
# systemctl Restart Networkmanager.service
NameServer 114.114.114.114nameserver 8.8.8.8
See MORE:
# Man networkmanager.conf# Mans NMCLI
How to set up a DNS server under CentOS 7