A customer asks for “a wildcard”. The team adds a wildcard A record and the customer’s site loads at any subdomain. The customer then asks why their browser shows a cert warning for something.example.com. The wildcard A is unrelated to the wildcard cert; they solve different problems and they don’t substitute for each other.
What’s happening
- Wildcard DNS (
*.example.com IN A 192.0.2.10): any subdomain that doesn’t have its own A record resolves to this IP. Pure DNS — affects what client sees as the IP for the name. - Wildcard certificate (subject
*.example.com): a TLS certificate valid for any single-level subdomain ofexample.com. The cert proves to the browser that the server is authorized to serve content for*.example.com. Pure crypto — affects whether the browser trusts the server’s TLS handshake.
You can have one without the other, in any combination:
- Wildcard DNS, no wildcard cert: every subdomain resolves to your IP, but only the names with specific certs serve HTTPS without browser warnings.
- Wildcard cert, no wildcard DNS: you have a cert that covers many names, but each subdomain needs its own A record before clients can reach it.
- Both: any subdomain resolves and HTTPS works.
- Neither: each subdomain explicitly published, each cert explicitly issued.
cPanel issues wildcard certs through AutoSSL only if the DNS-01 challenge is configured — HTTP-01 can’t validate wildcards (the challenge would need to be served at the apex, but the wildcard is for subdomains, not the apex). For DNS-01, cPanel publishes a TXT at _acme-challenge.example.com and the CA validates.
How to verify
Check the published cert:
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null \
| openssl x509 -noout -text | grep -A1 'Subject Alternative Name'
If the SAN list contains *.example.com, the cert is a wildcard. If it has only specific names (example.com, www.example.com), it’s not.
Check DNS:
dig +short '*.example.com' A
dig +short totally-fake-name.example.com A
If both return your IP, you have wildcard DNS.
Verify a specific subdomain:
echo | openssl s_client -connect subdomain.example.com:443 -servername subdomain.example.com 2>/dev/null \
| openssl x509 -noout -text | grep -A1 'Subject Alternative Name'
The cert presented for subdomain.example.com may be the wildcard (good) or a different cert (might not cover this name).
What to do
Decide which you actually need:
- Multi-tenant SaaS where each customer has their own subdomain (
<customer>.example.com): wildcard DNS + wildcard cert. Both are needed. The wildcard DNS resolves any new customer’s subdomain immediately; the wildcard cert lets the same server handle HTTPS for any of them without re-issuing certs. - Few well-known subdomains (
www,mail,cpanel,webmail,app): no wildcard for either. Explicit A records and explicit per-name certs. Each subdomain is intentional; the cert SAN list grows manually. - CDN or proxy front-end with predictable subdomain pattern: probably explicit A or CNAME for each, with a wildcard cert if the front-end terminates TLS for many names.
- Internal tools that should not be discoverable: no wildcard DNS (so typo’d subdomains don’t resolve); explicit certs only.
For setting up a wildcard cert via AutoSSL on cPanel:
- Enable DNS-01 challenge in WHM > AutoSSL > Configuration. cPanel needs to be able to publish TXT records in the zone, which it can if the zone is local; if the zone is at Cloudflare or Route 53, configure AutoSSL with the third-party’s API token.
- Run AutoSSL for the account. WHM > AutoSSL > Manage Users > Check the account, run.
- Verify the cert covers
*.example.com:
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null \
| openssl x509 -noout -text | grep -A1 SAN
- Confirm renewal works. AutoSSL re-runs on a cadence; if DNS-01 fails on renewal (token expired, DNS provider API changed), the cert lapses. Monitor cert expiry externally.
If you set up wildcard DNS, see the wildcard-security-caveats article first. Wildcard DNS without lockdown is a phishing surface.
Stack Harbor sets up wildcard certs and DNS in combination as part of deployment management.