Linux --- solution to DNS configuration loss after Ubuntu 14.04 is restarted --- ubuntu14.04

Source: Internet
Author: User

Linux --- solution to DNS configuration loss after Ubuntu 14.04 is restarted --- ubuntu14.04

Solution to DNS configuration loss after Ubuntu 14.04 is restarted

Each time the DNS configuration file/etc/resolv. conf is modified, it becomes invalid after it is restarted.

We can check from the Internet that this file is dynamically created, so it will be overwritten every time it is restarted. This file also has a warning:

Therefore, we cannot directly modify this file.

The following two methods are available:

1)

Vi/etc/network/interfacesdns-nameservers 8.8.8.8

2)

Vi/etc/resolvconf/resolv. conf. d/basenameserver 8.8.8.8nameserver 114.114.114.114

Write one line with multiple lines of IP.

Save the modification.

Then execute:

Resolvconf-u
View the head file:
Cat/etc/resolvconf/resolv. conf. d/head
This file is not loaded into the base content as it is said on the Internet.

But after the restart

The content in/etc/resolv. conf is not changed to the default value, but is loaded into the data in the base.

So far, the DNS configuration is lost after the 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.