The solution for automatic DNS resetting-Linux general technology-Linux technology and application information. For more information, see the following. When networkmanager is used to set the NIC, the DNS is automatically cleared every time the system is restarted. It is very troublesome to reset the DNS after each restart.
The nameserver configuration file is/etc/resolv. conf.
This is the normal content:
# Dynamic resolv. conf (5) file for glibc resolver (3) generated by resolvconf (8)
# Do not edit this file by hand -- YOUR CHANGES WILL BE OVERWRITTEN
Nameserver 202.102.152.3
After the restart, the nameserver 202.102.152.3 is deleted.
The above # Dynamic resolv. conf (5) file for glibc resolver (3) generated by resolvconf (8)
It can be seen that resolv. conf is generated by resolvconf. Edit the vim/etc/resolvconf/resolv. conf. d/head File
Display the same content as resolv. conf:
# Dynamic resolv. conf (5) file for glibc resolver (3) generated by resolvconf (8)
# Do not edit this file by hand -- YOUR CHANGES WILL BE OVERWRITTEN
Enter nameserver 202.102.152.3
Save and exit,
Resolvconf-u
In this case, you can access the Internet normally. After restarting, you do not need to reset the DNS. (E: e2s
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