Solution for failure of CentosDNS restart

Source: Internet
Author: User
Tags nameserver
The failure of CentosDNS Restart solves the problem of installing the desktop through yum during the configuration of KT's poisonous women. Gnome is installed by default, and everything works normally before the restart, no network access is available. ping and test it. hostunkown. it can be basically confirmed that the Centos DNS of the DNS is restarted and the desktop is installed through yum during the configuration of the accesskey of KT, gnome is installed by default, and everything is normal before it is restarted. after it is restarted and configured, it is found that there is no network access. ping and test the host unkown; it is basically a DNS issue. Check/etc/resolv. conf file, found that # Generated by NetworkManager, this should be caused by the installation of gnome Network management during the installation of the desktop, it takes over the network settings, but obviously this is not what I need, directly modify/etc/resolv. conf. after the server is restarted, the dns becomes invalid again. Solution 1: modify/etc/resolv. conf: add nameserver 8.8.8.8nameserver 8.8.4.4 and disable NetworkManager and service NetworkManager stop. check whether the system is enabled. in this way, you can continue to use the dns defined by us. Solution 2 (recommended): add dns information to the interface. edit/etc/sysconfig/network-scripts/ifcfg-ethX. the specific X is determined based on your Nic, add DNS1 = 8.8.8.8DNS2 = 8.8.4.4 save and restart the network/etc/init. d/networking restart to solve the problem. Solution 3 (not tested, provided by netizens): modify/etc/resolv. conf and set permissions to permanently write data to the custom DNS. After adding a nameserver according to solution 1, run chattr + I/etc/resolv. conf. this command modifies the file attribute so that only the root user can modify the file. (You can change the parameter to "-I "). Then run service NetworkManager restart.
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: info-contact@alibabacloud.com 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.