Pi-hole with DNS over HTTPS (DoH) via cloudflared.
- Pi-hole DNS server and ad blocker
- DNS over HTTPS (DoH) via cloudflared
- Web interface behind Traefik reverse proxy (to enable HTTPS)
If port 53/udp is used on the host system, you need to stop and disable the systemd-resolved service:
nano /etc/systemd/resolved.confSet the DNSStubListener to no:
DNSStubListener=no
Create a symlink and restart the systemd-resolved service afterwards:
ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
systemctl restart systemd-resolved-
DNS
AorCNAMErecord pointing to your server for the Pi-hole web interfaceExample:
# A record dns.borntoberoot.net --> 192.168.178.10 # CNAME record dns.borntoberoot.net --> server01.borntoberoot.net -
Adjust the configuration based on your needs in the following files:
/opt/container/stacks/pihole_doh/docker-compose.yml/opt/container/stacks/pihole_doh/.env
-
Start the stack with
docker compose up -d