1

Network manager keeps modifying resolve.conf and there is no stopping it in Ubuntu 18.04. I tried removing write permissions, change resolve.conf symlink to another file and... I also looked at network manager: how to stop nm updating /etc/resolv.conf but none of the solutions seems to be working in this Ubuntu version.

hamidfzm
  • 971

1 Answers1

4

There are various ways to configure NM not to touch /etc/resolv.conf:

[main]
dns=none

or (better)

[main]
rc-manager=unmanaged

in NetworkManager.conf. See man NetworkManager.conf.

You can also set rc-manager=symlink, and make /etc/resolv.conf a symlink pointing to a file (like systemd-resolved's stub resolve.conf). Well, you said, you tried this. Unclear, why that wouldn't work for you.

Or, you make the file immutable, with chattr +i /etc/resolv.conf.

hamidfzm
  • 971
thaller
  • 921
  • I'd love your help on this related question. Thanks! https://askubuntu.com/questions/1453982/ubuntu-22-04-1-nameservers-keep-getting-overwritten – Ryan Feb 08 '23 at 03:23