Hi, first I’m not sure if my question makes sense because I lack knowledge on that topic. My “problem” may not have anything to do with Caddy, but I ask anyway. I’m trying to setup a private DNS server with DoT support (DNS over TLS).
So I configured a blocky instance (via docker). It works as expected, from my clients machines dns queries are resolved etc. In the other hand, I’m using Caddy as a reverse proxy server (installed also via docker, present on the same network as blocky service). And I got the idea to setup DoT.
Now I need to somehow provision a certificate for the dns TLS needs. Does it make sense to use the caddy instance to handle that?
In a naive approach, I came up with this in my Caddyfile
(simplified), trying to somehow reverse proxy a specific subdomain for DoT dot.domain.fr
to blocky server on the TLS port but without any success
*.domain.fr, domain.fr {
tls {
dns cloudflare {env.CLOUDFLARE_API_TOKEN} # Im using CloudFlare as a DNS provider for my domain
}
# blocky DoT, not working
@dot {
host dot.domain.fr
import privateSubnets
}
handle @dot {
reverse_proxy blocky:853 # blocky tls port is set to 853 in its config
}
# blocky DoH, working fine
@doh {
host dns.domain.fr
import privateSubnets
}
handle @doh {
reverse_proxy blocky:1234
}
But when I try to use the dns server from my client machines with systemd-resolved
for instance (with DNSOverTLS=yes
). Using 11.22.33.123#dot.domain.fr
as dns address (11.22.33.123
being the public IP of my server), it fails to resolve any dns queries.
Any help would be really appreciated!
caddy version
v2.6.4 h1:2hwYqiRwk1tf3VruhMpLcYTg+11fCdr8S3jhNAdnPy8=
system environment
Arch Linux, Docker