I built a Ubuntu Server 18.04 server to play with Docker and a few other things. When I initially installed Server I had some issues with Netplan and getting DNS (my own server) to work, but I go there in the end and all was working fine.

There were a few other things I wanted to do, that I felt required me to have a GUI installed, so I installed Ubuntu-Desktop using apt install --no-install-recommends Ubuntu-Desktop. After a reboot, there was the GUI and I was able to login. Great!

However, I no longer have DNS working again, and I didn't record what I did first time to sort it!. If I do an nslookup of a local host I get: ;; reply from unexpected source:, expected

As always my first response is to Google for assistance, but I don't relly understand the various suggestions so don't want to wildly start typing commands in the terminal.

All I have done thus far is to confirm my netplan config is still there and reapplied it. I also installed resolvconf which was one of the suggestions. If I open /etc/resolv.conf I see Generated by NetworkManager. I am more familiar with CentOS and have no experience of Netplan other than what I did earlier when I first installed.

Any advice and explanation would be appreciated....

UPDATE 1: I'm wondering if this has anything to do with Docker being installed on this system??

UPDATE 2: As requested, here are the outputs of those commands:

$ dpkg -l *dnsmasq*
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                        Version            Architecture       Description
un  dnsmasq                     <none>             <none>             (no description available)
ii  dnsmasq-base                2.79-1             amd64              Small caching DNS proxy and DHCP/TFTP server
un  dnsmasq-base-lua            <none>             <none>             (no description available)

$ ls -al /etc/resolv.conf
lrwxrwxrwx 1 root root 39 May  8 16:06 /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf

$ cat /etc/resolv.conf
# This file is managed by man:systemd-resolved(8). Do not edit.
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
# Run "systemd-resolve --status" to see details about the uplink DNS servers
# currently in use.
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

options edns0
search home.domain

$cat /etc/netplan/*.yaml
  version: 2
  renderer: networkd
      dhcp4: no
      dhcp6: yes
      addresses: []
          - home.domain

$ cat /etc/network/interfaces
# ifupdown has been replaced by netplan(5) on this system.  See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
#    sudo apt install ifupdown

auto eth0
iface etho inet static
        dns-domain home.domain
        dns-search home.domain

UPDATE 3: Heynnema tried to help me. We corrected the /etc/network/interfaces file as per his comments, and uninstalled dnsmasq-base which we believe was left over from a removed Pi-hole install. Now nslookup returns a failure trying

UPDATE 4: Output of ps auxw |grep systemd

root       474  0.0  0.2 118876 33216 ?        S<s  May08   0:01 /lib/systemd/systemd-journald
root       519  0.0  0.0  47160  5784 ?        Ss   May08   0:02 /lib/systemd/systemd-udevd
systemd+   747  0.0  0.0 141924  3348 ?        Ssl  May08   0:00 /lib/systemd/systemd-timesyncd
systemd+   881  0.0  0.0  71968  5996 ?        Ss   May08   0:00 /lib/systemd/systemd-networkd
root       987  0.0  0.0  70604  6192 ?        Ss   May08   0:01 /lib/systemd/systemd-logind
message+  1041  0.0  0.0  51620  6140 ?        Ss   May08   0:04 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
gdm       1789  0.0  0.0  76984  7948 ?        Ss   May08   0:07 /lib/systemd/systemd --user
neild+  8004  0.0  0.0  77024  7928 ?        Ss   May08   0:07 /lib/systemd/systemd --user
neild+ 26628  0.0  0.0  13136  1072 pts/0    S+   19:37   0:00 grep --color=auto systemd

UPDATE 5: I managed to get systemd-resolved working again and thus /etc/resolv.conf to exist by running systemctl enable systemd-resolved.service and then systemctl start systemd-resolved.service

nslookup now gives ;; reply from unexpected source:, expected again

UPDATE 6: Found the issue, but no idea why it only started being an issue. So I have Docker running with a Pi-Hole container (I hear you all grown!) which is using port 53 and preventing systemd from working correctly. The docker-proxy process had the port instead.

When I stop the docker service and restart systemd-resolve all works as expected, so I have temporarily removed my Pi-Hole container.

Is there a way to get both working together?

  • Edit your question and show me dpkg -l *dnsmasq* and ls -al /etc/resolv.conf and cat /etc/resolv.conf and cat /etc/netplan/*.yaml and cat /etc/network/interfaces. – heynnema May 8 at 15:34
  • @heynnema Please see Update 2 above – neildeadman May 8 at 18:34
  • I see two potential problems... 1) your symlink for /etc/resolv.conf is probably incorrect... more on that later. 2) you've defined your network in both /etc/netplan/*.yaml and /etc/network/interfaces. You're combining netplan and NetworkManager definitions at the same time. Since you're on a server, you should be using netplan. Edit your interfaces file to only contain auto lo and iface lo inet loopback. (and network is spelled incorrectly). – heynnema May 8 at 18:42
  • dnsmasq-base may also be a problem. Do you need that for any particular reason? More on that later. – heynnema May 8 at 18:46
  • @heynnema Thanks, no idea how that content got added to interfaces file if not there by default as I certainly didn't dd it. I've edited the file and am rebooting now. – neildeadman May 8 at 18:51

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.