Ubuntu configure local dns: reboot does not disappear

If you add dns to the /etc/resolv.conf file to restart or switch the network, it will be overwritten;

 

Solution:

Modify /etc/network/interfaces

For example: vim /etc/network/interfaces

Add a rule: eg dns-nameservers 1.1.1.1

 

This method will automatically add nameserver 1.1.1.1 to resolv.conf after restarting

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326360991&siteId=291194637