Set DNS under CentOS7

Source: Internet
Author: User
In CentOS7, how does one set the DNS server under CentOS7 and manually set the DNS in/etc/resolv. conf? after a while, the system overwrites or clears the DNS server. Different from setting DNS in CentOS6, there are several methods: 1. use the new command line tool nmcli to set # display the current network connection # Under nmcliconne CentOS 7, how to set the DNS server to manually set/etc/resolv under CentOS 7. after a while, the DNS in conf will be overwritten or cleared by the system. 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 name or UUID # nmcli con mod eno1 ipv4.dns "" # apply the dns configuration # nmcli con up eno1 2. 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 for details, see: # man NetworkManager. conf # man nmcli
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.