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: 127.0.0.1#53, expected 127.0.0.53#53
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* Desired=Unknown/Install/Remove/Purge/Hold | 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. nameserver 127.0.0.53 options edns0 search home.domain $cat /etc/netplan/*.yaml network: version: 2 renderer: networkd ethernets: enp2s0: dhcp4: no dhcp6: yes addresses: [192.168.1.6/24] gateway4: 192.168.1.1 nameservers: addresses: - 192.168.1.3 search: - 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 address 192.168.1.6 netmask 255.255.255.0 netowrk 192.168.1.0 broadcast 192.168.1.255 gateway 192.168.1.1 dns-nameservers 192.168.1.3 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 127.0.0.1.
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: 127.0.0.1#53, expected 127.0.0.53#53 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?