|
Under normal circumstances, we can set the DNS address resolv.conf in Ubuntu system. But after the restart, resolv.conf the address will still be returned to the original content.
This is because the resolv.conf file is actually a Link file
There is a resolvconf service in Ubuntu, this service is used to control the content of the /etc/resolv.conf. So once we restart the system or the service, then the /etc/resolv.conf file contents will be restored to the original content. So directly modify /etc/resolv.conf does not solve the problem.
Solution:
1. Define the DNS address in network card 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 resolvconf service:
vim /etc/resolvconf/resolv.conf.d/base
Where you can add or modify:
nameserver 8.8.8.88.8.4.4 |
|
|
|