Completely solve the problem of DNS configuration loss after Ubuntu 14.04 restart

Source: Internet
Author: User

Recently get a more useful DNS, after each reboot to modify the DNS configuration file/etc/resolv.conf restart will expire

Learned from the Internet/etc/resolv.conf in the DNS configuration is loaded from the/etc/resolvconf/resolv.conf.d/head, so every change resolv.conf will fail, in this file has been described

Open the/etc/resolv.conf content as follows: cat/etc/resolv.conf

# Dynamic resolv.conf (5) file for glibc resolver (3) generated by resolvconf (8) # don't EDIT this file by Hand-your CHANG ES'll be overwritten

The content is a warning: say this file is created dynamically by the RESOLVCONF program, do not edit directly, the modification will be overwritten.

So we can't modify this file directly.

There are two ways to check the data:

Method 1:

Su8.8. 8. 8  

Method 2: (This file is empty by default)

Su8.8. 88.8.4.4    

If you have multiple DNS, one line

Modify the save and then execute

Resolvconf-u

sudo vim/etc/resolvconf/resolv.conf.d/head

Open inside shows as follows

Look at/etc/resolv.conf, the bottom is more than 2 lines:

8.8. 88.8.4.4   

Now this DNS is in effect, no reboots, and of course, reboots are not lost.

There is also a way to modify/etc/resolvconf/resolv.conf.d/headsudo Vim/etc/resolvconf/resolv.conf.d/head

# Dynamic resolv.conf (5) file for glibc resolver (3) generated by resolvconf (8) # don't EDIT this file by Hand-your CHANG ES'll be overwritten

This file does not prompt manual modification ... It is not recommended to change this file according to the system prompt

Troubleshooting DNS configuration loss after Ubuntu 14.04 restart

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.