Caddy's DNS Challenge Gets Trusted HTTPS on a Homelab Without Opening a Single Router Port
Using an ACME TXT record instead of port 80 lets Let's Encrypt or ZeroSSL sign certificates for private LAN services, though you still need API credentials or a CNAME handoff.

Running self-hosted dashboards on a home network usually hands you an ugly choice: click past red browser warnings forever, or forward ports 80 and 443 on your router so a certificate authority can reach your box. Caddy, which has shipped automatic HTTPS by default since 2015, offers a clean exit through the ACME DNS challenge—the one time a cryptic TXT message actually fixes a relationship with your browser.
By default, Caddy tries to prove you own a public domain for Let’s Encrypt or ZeroSSL using two inbound checks: the HTTP challenge on port 80 and the TLS-ALPN challenge on port 443. Both look up your domain’s authoritative A or AAAA record and knock directly on your server from the public internet. If Caddy cannot bind those ports directly, your router has to forward them inside (inviting every scanner on earth).
The DNS challenge flips the whole handshake around. Instead of waiting for an inbound connection, the certificate authority queries your domain’s authoritative DNS for a specific temporary TXT record. Caddy’s documentation states the payoff plainly: “This challenge does not require any open ports, and the server requesting a certificate does not need to be externally accessible.” Flip the DNS challenge on, and Caddy automatically disables the inbound HTTP and TLS-ALPN checks.
You might wonder why homelab admins don’t just lean on Caddy’s built-in local HTTPS mode and call it a day. For non-public names like localhost, 127.0.0.1, or .local and .home.arpa hosts, Caddy generates its own Smallstep-powered certificate authority under pki/authorities/local, signing leaf certificates from an auto-renewing intermediate. On a single workstation, Caddy tries to install “Caddy Local Authority” into your trust store automatically—convenient until you run it in a container or as an unprivileged system service, where auto-install isn’t guaranteed. As the docs note, “Any client accessing the site without trusting Caddy’s root CA certificate will show security errors.” Distributing a homemade root CA across every phone, tablet, and family laptop turns a weekend homelab into an unpaid helpdesk shift (nobody brings donuts either).
Switching to the DNS challenge trades that client-side chore for one upfront server setup. Because Caddy has to write and clear those temporary TXT records itself, it needs credentials for your DNS provider alongside a community-maintained Caddy DNS plugin. If your registrar still treats APIs like futuristic luxury goods—or lacks a plugin—Caddy supports a neat workaround: create a CNAME record that delegates only the _acme-challenge subdomain to another DNS zone that does support automation. You just need a real public domain name—single left-most wildcards like *.example.com qualify too—since .localhost, .local, .internal, and .home.arpa never get publicly trusted certificates.
One sharp edge awaits anyone who likes to experiment live: hammering a production ACME endpoint while debugging a broken config can trip rate limits that block fresh certificates for up to a week. Caddy’s docs recommend pointing test runs at Let’s Encrypt’s staging directory (https://acme-staging-v02.api.letsencrypt.org/directory) first. And if your private network already runs on Tailscale, .ts.net domains skip Caddy’s ACME flow completely—Caddy pulls those certificates from the local tailscaled daemon at handshake time, as long as HTTPS is enabled on the account and Caddy has permission to ask. Whether your DNS provider’s community plugin keeps up the next time you switch registrars is the main loose end.
Private networks with real public domains are quickly becoming the default blueprint for anyone who runs serious gear at home. Once a cheap domain and an automated TXT record give a closet server the same green padlock as a cloud app, clicking “Advanced” and bypassing warnings every morning feels like hot-wiring your own car just to drive to the mailbox.
The tradeoff is that DNS automation moves the sensitive piece from your router’s port-forwarding table to your DNS API credentials. Giving an internal server tokens that can alter live DNS records means tightly scoped permissions—or isolating validation behind an _acme-challenge CNAME zone—will matter more as more self-hosters adopt the pattern. Still, for operators tired of picking between open ports and trust-store maintenance, passing a note through DNS beats leaving the front door unlocked.
Closed ports, valid certs, zero warnings.