Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to disable systemd-resolved in Ubuntu

How to disable systemd-resolved in Ubuntu

Stages

  • Disable and stop the systemd-resolved service:

      sudo systemctl disable systemd-resolved.service
      sudo systemctl stop systemd-resolved
    
  • Then put the following line in the [main] section of your /etc/NetworkManager/NetworkManager.conf:

      dns=default
    
  • Delete the symlink /etc/resolv.conf

      rm /etc/resolv.conf
    
  • Restart network-manager

      sudo service network-manager restart
    

Sources

@nelebadnjak

This comment has been minimized.

Copy link

@nelebadnjak nelebadnjak commented Mar 10, 2020

This is wrong, instead of dns=none it should be dns=default

@zoilomora

This comment has been minimized.

Copy link
Owner Author

@zoilomora zoilomora commented Mar 10, 2020

This is wrong, instead of dns=none it should be dns=default

Yes, I don't know what happened at the time of writing, but currently I have dns=default, thanks for warning!

@tweakunwanted

This comment has been minimized.

Copy link

@tweakunwanted tweakunwanted commented Apr 2, 2020

what is dns=default tho? I use 1.1.1.1 on my resolv.conf and want to keep using that

@zoilomora

This comment has been minimized.

Copy link
Owner Author

@zoilomora zoilomora commented Apr 2, 2020

@tweakunwanted you can see the documentation of NetworkManager. If you don't want /etc/resolv.conf to be changed, assign dns=none.

@antonalechnovic

This comment has been minimized.

Copy link

@antonalechnovic antonalechnovic commented May 10, 2020

Thanks for fixing my VPN wish I'd find this 2 hours before.

@sej7278

This comment has been minimized.

Copy link

@sej7278 sej7278 commented Aug 9, 2020

Any idea how to do this on centos8 - even systemctl mask systemd-resolved doesn't fix it, none of the above does either and /etc/resolv.conf isn't a symlink on centos8, dns=none is the default

@JakeSays

This comment has been minimized.

Copy link

@JakeSays JakeSays commented Oct 6, 2020

This just saved my butt. For some reason resolved just decided to stop working. After two hours of pain killing resolved did the trick. Yet one more reason why I hate systemd. Just want it do die a painful death.

@dag-erling

This comment has been minimized.

Copy link

@dag-erling dag-erling commented Oct 13, 2020

Just a nit: I find it odd that you use service to restart NetworkManager and not systemctl since the former is just a compatibility wrapper around the latter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.