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.