DNS isn’t a redirect
A small lesson from setting up this homelab: pointing a wildcard DNS record at a server doesn’t make every hostname ready for HTTPS.
There are three separate steps:
- DNS finds the server. A wildcard A record can point unused subdomains at the same machine.
- TLS establishes the secure connection. The server needs a certificate covering the hostname the browser asked for.
- HTTP returns the redirect. Only after the secure connection succeeds can the server send the browser somewhere else.
That ordering matters. A redirect to a working HTTPS site cannot rescue a failed TLS handshake at the original address. A wildcard certificate can cover the single-label subdomains, but it needs DNS validation and automatic renewal.
There was another small catch with www: an explicit CNAME pointing at Gandi’s
parking service took precedence over the wildcard record. Removing that override
let www reach the homelab server.
The useful habit: check DNS, the certificate, and the HTTP response separately. They answer different questions.