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
2
  • What does /etc/resolv.conf say?
    – mtak
    Dec 9, 2021 at 14:44
  • @mtak added above Dec 9, 2021 at 15:25

1 Answer 1

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

2
  • 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? Dec 13, 2021 at 9: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 zwischenzugs.com/2018/06/08/… for details, because there are some extra layers in there.
    – mtak
    Dec 13, 2021 at 12:20

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.