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