0

I will be running a Pi-hole server in a docker container, so I have freed up port 53 by settingDNSStubListener=no in /etc/systemd/resolved.conf and restarting systemd-resolved.

This has freed up port 53, but now DNS doesn't work. I get ;; connection timed out; no servers could be reached

Looking at Network Settings from the desktop, I see 1.1.1.1 and 8.8.8.8 as the DNS servers assigned by DHCP as currently configured, but how do I get my system to use these?

UPDATE1: /etc/resolv.conf has this:

nameserver 127.0.0.53
options edns0 trust-ad
search domain.local
neildeadman
  • 111
  • 1
  • 6

1 Answers1

0

The DNS servers assigned through DHCP will used to configure resolved. The rest of the system uses whatever is configured in /etc/resolv.conf to resolve addresses. resolv.conf is pointing to 127.0.0.53, which doesn't work anymore, because you disabled resolved.

Change /etc/resolv.conf to point to active DNS servers:

domain domain.local
nameserver 8.8.8.8
nameserver 8.8.4.4

Edit: on how to use DHCP assigned DNS servers instead of setting them manually, see https://unix.stackexchange.com/a/453122/52365

mtak
  • 1,274
  • 10
  • 13
  • so if I use a browser to open a local URL (hosted in Docker or another system) which DNS entry is used? Same for `curl` and `nslookup`? – neildeadman Dec 13 '21 at 09:01
  • For a browser specifically, it depends on whether it uses DNS-over-HTTPS. But yeah, in general all applications use the same resolving mechanism. Review https://zwischenzugs.com/2018/06/08/anatomy-of-a-linux-dns-lookup-part-i/ for details, because there are some extra layers in there. – mtak Dec 13 '21 at 12:20