Skip to content

Instantly share code, notes, and snippets.

@zoilomora
Last active May 13, 2024 16:49
Show Gist options
  • Save zoilomora/f7d264cefbb589f3f1b1fc2cea2c844c to your computer and use it in GitHub Desktop.
Save zoilomora/f7d264cefbb589f3f1b1fc2cea2c844c to your computer and use it in GitHub Desktop.
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
      or
      sudo systemctl restart NetworkManager.service
    

Sources

@jbbandos
Copy link

I was going crazy with this on the steam deck. NetworkManager kept creating a resolv.conf always pointing to 127.0.0.53.
Until I found that SteamOS (arch in disguise) had created a /etc/NetworkManager/conf.d/dns with a
[main]
dns=systemd-resolved
And that was being used instead of my conf file with dns=default...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment