This is the way. Been running (basically) this for years and genuinely keep my eye out for any simpler suggestions, but nothing comes close.
I do it slightly different where I use an external DNS (bunny) and point the A records to the tailscale IP of the server running Caddy.
The benefits are:
- I don’t force the whole house to rely on my local DNS setup.
- Nothing breaks when I change routers and mess up IP mappings (which I was doing a lot, but I finally got some nice unify equipment, so maybe I don’t have to worry about that anymore).
- I don’t “leak my LAN configuration” to public DNS but I don’t care about that anymore.
- I can use Tailscale DNS override if I want just my tailnet devices to go through some private/premium DNS resolver.
- Don’t need to set up subnet routing in Tailscale
The downside is it doesn’t work at all for devices not on Tailscale. Real bummer when, like, I want my smart TV to just be able to find jellyfin on my LAN with the same domain names. But everything else about it is very convenient.
123@programming.dev 2 weeks ago
To further simplify.
For step 1+2 , the router might have a built in DNS resolver which would eliminate the need to maintain another container or service.
For step 5, depending in the router software, with a single target (e.g. a nas running docker services) you might also be able to add a wildcard rule to catch any query for *.local.domain.com to resolve to that machine. This would simplify adding things in the future as the only thing remaining would be the caddy config.