Ubuntu failure in resolv. conf restart
In general, we can use resolv. conf in ubuntu to set the DNS address. After restart, the address in resolv. conf will still return the original content.
This is becauseThe resolv. conf file is actually a Link file.,
Vconf service, which is used to control the content of/etc/resolv. conf. So once we restart the system or the service, the content in the/etc/resolv. conf file will be restored to the original content. Therefore, directly modifying/etc/resolv. conf does not solve this problem.
Solution:
1. Define the DNS address in the NIC configuration file:
Iface eth0 inet static
Address 192.168.0.10
Netmask 255.255.255.0
Gateway 192.168.0.1
Dns-nameserver 8.8.8.8 8.8.4.4
2. modify the configuration file of the resolvconf service:
Vim/etc/resolvconf/resolv. conf. d/base
Add or modify:
Nameserver 8.8.8.88.8.4.4