阻止Network Manager修改resolv.conf

I do not want network manager to add DNS servers received from DHCP to my /etc/resolv.conf.

When configuring from GUI/Connections/IPV4 and choose the method Automatic (address only) it still adds DNS servers received via DHCP.

Is it possible to do it per connection (specific ssid ?)

Answer:

One way to stop Network Manager from adding dns-servers to /etc/resolv.conf file is to do this:

First open the nm conf file /etc/NetworkManager/NetworkManager.conf:

sudo vim /etc/NetworkManager/NetworkManager.conf

And add this to the [main] section:

dns=none

Save and exit.

原文链接: https://askubuntu.com/questions/623940/network-manager-how-to-stop-nm-updating-etc-resolv-conf

发表评论

邮箱地址不会被公开。 必填项已用*标注