Ubuntu Server 18.04. I have been running PiHole on my Ubuntu server for a while now, and decided to break that service off onto a dedicated machine. After uninstalling it however, my server is unable to resolve any DNS names itself. I seem to have fixed this by adding the DNS server to the .yaml file in /etc/netplan and running netplan apply, but it doesn't stick after a reboot. I've applied a sort of duck tape fix by putting netplan apply in /etc/rc.local, but that doesn't really fix whatever the Pihole uninstaller broke.

I also tried:

sudo systemd-resolve -i enp2s0 --set-dns= being my local DNS server and new PiHole (it's working with every other system), and got

The specified interface enp2s0 is managed by systemd-networkd. Operation refused. Please configure DNS settings for systemd-networkd managed interfaces directly in their .network files.

Problem is, I can't seem to find anything named enp2s0.network anywhere on the system.

netplan apply with a modified .yaml file seems to be the only thing that works, but it isn't applying on reboot for some reason without me just sticking the command into my /etc/rc.local so that it runs on bootup.

I would love to just reset all of the networking configurations to their default, like I just did a clean install of the OS, but I'm not sure what that is since Ubuntu has had so many changes in recent years to how it operates.

  • I would look at /etc/network, and /etc in general. Before you run that netplan apply, which DNS server does your resolv.conf refers to? Have you tried grep -R <address> /etc? – SYN Jun 28 '19 at 6:02
  • /etc/resolve.conf pointed to itself, I could modify that entry and it would fix it, but again, that didn't persist after reboot, and the file specifically stated as much in the comments, hence my desire to figure out what command or service I should be using to commit the change properly. I uninstalled resolvconf at the recommendation of somebody in the IRC, thinking maybe it wasn't the default service and might have been installed by Pihole, and netplan apply still works after uninstalling resolvconf, but I depend on having the command in rc.local to force it to apply at startup. – Gerowen Jun 28 '19 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.