I've decided systemd-resolved is irretrievably broken garbage and I'd like to replace. I've got my own local DNS server at I'd like. I'd also like to connect to a VPN with NetExtender that gives me a DNS server for a .local domain. I would like these two things to work together, what can I do?


3 Answers 3


The answer by Gannet is incorrect. If you want to use plain ifupdown like in earlier releases, without netplan or NetworkManager (e.g. on a server), with dhcp, you need to do this:

systemctl disable systemd-resolved.service
systemctl stop systemd-resolved.service

# check if resolv.conf is pointing to resolvconf
ls -la /etc/resolv.conf
# lrwxrwxrwx 1 root root 27 May  7 16:15 /etc/resolv.conf -> /run/resolvconf/resolv.conf
# if not, delete /etc/resolv.conf and symlink it like this: 
rm /etc/resolv.conf
ln -s /run/resolvconf/resolv.conf /etc/resolv.conf

# this will remove the resolved stub resolver entry from resolv.conf
resolvconf -d systemd-resolved

# fix dhclient scripts
chmod -x /etc/dhcp/dhclient-enter-hooks.d/resolved
chmod +x /etc/dhcp/dhclient-enter-hooks.d/resolvconf

# on my machine just chmod -x wasn't enough, I had to move the resolved script somewhere else
mv /etc/dhcp/dhclient-enter-hooks.d/resolved ~

# ifdown/ifup your interface to regenerate resolv.conf (or systemctl restart ifup@eth0)
ifdown eth0; ifup eth0

# check /etc/resolv.conf has the right settings

  • You, sir, are one of those unknown heroes that save the day.
    – ata
    Jun 8, 2021 at 2:17

You can always disable your systemd-resolved by

systemctl disable systemd-resolved.service

command. And run:

sudo rm /etc/resolv.conf && sudo ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf

to use /etc/resolv.conf config as it was earlier in previous ubuntu versions.

  • can it be removed via apt ? Jan 10, 2020 at 9:20

Both answers can lead to issues with VPN. Also, if it's desired to keep NetworkManager, the following can be done:

Unlink resolvconf if this is linked to resolvectl:

ls -lah $(which resolvconf)

If resolveconf is linked to resolvectl, like the following:

/usr/local/bin/resolvconf -> /usr/bin/resolvectl

We need to unlink it:

sudo unlink /usr/local/bin/resolvconf

Now, install resolvconf because most VPN uses it:

sudo apt-get install resolvconf

set dns=none to [main] section in /etc/NetworkManager/NetworkManager.conf:


Now, we have two options here:

  • Manually set DNSes system-wide
  • Use resolvconf to set DNS:

Manually set DNSes system-wide

Place desired DNS servers as nameserver in /etc/resolv.conf:


Use resolvconf to set DNS

This is preferred way if you're using a VPN with specific DNS servers configured through it

sudo ln -sfn /run/resolvconf/resolv.conf /etc/resolv.conf
  • I followed your guide and now I have no internet. Any help would be appreciated. Thanks!
    – Alex
    Nov 2, 2022 at 1:49
  • I made a new post about this. Feel free to comment there. Thanks askubuntu.com/questions/1438645/…
    – Alex
    Nov 2, 2022 at 2:01
  • @Alex could you please post modified files content? - ls -lah $(which resolvconf) - /etc/NetworkManager/NetworkManager.conf - /etc/resolv.conf
    – meetnick
    Jan 11 at 15:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .