I want to use AdGuard Home as well as DNS-over-TLS using Caddy as the reverse proxy for adguard.example.com.
Everything is running on Proxmox. The webinterface runs fine by simply redirecting port 443 to 3000, which is where AdGuard home has its interface.
Though I can’t get DNS-over-TLS to work, which is on Port 853.
2. Error messages and/or full log output:
Client says it can’t connect to the server.
# I've temporarily enabled the access log and while the webinterface produces tons of logs, DNS-over-TLS does nothing
3. Caddy version:
v2.10.0
4. How I installed and ran Caddy:
Custom xcaddy:
xcaddy build --with github.com/mholt/caddy-l4
Then did the whole caddy.default, caddy.custom and update-alternatives thing from the official guide.
a. System environment:
Caddy in Debian in Proxmox LXC using the Proxmox Community Scripts
Your configuration doesn’t have anything for the layer4 app. You’ve only configured the HTTP server of Caddy. DNS-over-TLS is not HTTPS. It runs TLS on raw TCP connections without an HTTP layer. Here’s the possible config for it:
Unfortunately, Adguard Home doesn’t support connections with the PROXY protocol, so Caddy cannot use that technology to deliver the original remote IP address.
There may be a way to manage it using iptables, but that’s beyond my knowledge.
I’ve now switched to forwarding port 853 and 53 to my AdGuard Home machine directly and only forward port 80 to 80 (for certbot) and 443 to 3000 (for web interface) via Caddy.