How to Secure Subdomains with SSL
To secure subdomains with SSL, cover every name that serves HTTPS: one wildcard, one certificate listing each name, or one per subdomain. Each has a different cost when names change.
The three approaches
| Approach | Covers | Validation | Tradeoff |
|---|---|---|---|
Wildcard (*.example.com) | Any one-level subdomain, current and future | DNS only | One key covers many hosts, so leaks have wide impact |
| SAN list | Exactly the names you list | HTTP or DNS | Must reissue to add a name |
| One certificate per subdomain | One hostname each | HTTP or DNS | More certificates to manage, strongest isolation |
What a wildcard does not cover
- The root domain itself. Add
example.comas a separate name on the same certificate. - Deeper levels.
*.example.commatchesapp.example.combut notdev.app.example.com.
Secure subdomains with SSL: the wildcard
sudo certbot certonly --manual --preferred-challenges dns \
-d example.com -d "*.example.com"
Certbot asks you to create a TXT record at _acme-challenge.example.com. Check that it is visible with the DNS Lookup before you continue. For automatic renewal, use a DNS provider plugin, since manual TXT records cannot renew unattended.
Issue individual or SAN certificates
sudo certbot --nginx -d blog.example.com
sudo certbot --nginx -d blog.example.com -d shop.example.com
This works with HTTP validation as long as each subdomain's DNS points to the server that answers the challenge.
Secure subdomains with SSL: which approach
- Few, stable subdomains: individual certificates.
- Many subdomains created on demand, such as customer tenants: wildcard.
- Subdomains on different servers: avoid copying one wildcard key around. Issue separate certificates per server.
Reduce the risk
If a wildcard private key is stolen, an attacker can impersonate any subdomain until the certificate expires or is revoked. Restrict key permissions, avoid copying it to many machines, and use a CAA record to control who may issue for your domain. Check it with the CAA Checker.
Verify
Open a few subdomains in the SSL Checker and confirm the SAN list shows the wildcard or exact names. Also test a name the certificate should not cover, like a two-level subdomain, so you know what to expect. For the multi-domain case, read how to get free SSL for multiple domains.
Common mistakes
Expecting a wildcard to cover the root domain, adding the DNS challenge record to the wrong zone or with a stale value, and sharing a wildcard private key across servers that different teams manage. Keep the TXT record name exact, wait for propagation before confirming, and give each server its own certificate if you can.
Related reading: the wildcard route for many names, installing a wildcard certificate and covering the www and apex names.
Frequently Asked Questions
Is a wildcard certificate free?
Yes. Let's Encrypt issues wildcards at no cost with DNS validation.
Does a wildcard include the apex domain?
No. List example.com alongside *.example.com.
Can a wildcard cover multiple levels?
No, only one level.
Why did my wildcard request fail?
Usually the TXT record was missing, was not yet propagated, or was added to the wrong zone.
Does a wildcard cover the apex domain?
No. *.example.com does not include example.com. Add the apex as a second name on the same certificate if you serve both.
How many names can one certificate hold?
It varies by authority, and there is a practical limit on the request size. If you have dozens of names, a wildcard is simpler than a long list.
What breaks when a subdomain is added later?
Nothing with a wildcard, because the name is already covered. With a list certificate you have to reissue to add the name, which is the cost that decides the choice.
Do subdomains need their own DNS records?
Yes. The certificate proves identity, but the name still has to resolve to a server that serves it, or the certificate has nothing to protect.
✅ Post-Installation Verification & SEO Checklist
After applying the steps above, run through this 5-point checklist to prevent browser warnings and protect your Google SEO rankings:
- Verify full CA chain trust and TLS 1.3 support using our Live SSL Checker.
- Scan for Mixed Content HTTP links and check HSTS/CSP headers on Security Headers Checker.
- Enforce a permanent 301 HTTP-to-HTTPS redirect with our HTTPS Redirect Generator.
- Confirm both root and
wwwversions resolve cleanly to one canonical HTTPS URL. - Verify your HTTPS property and
sitemap.xmlinside Google Search Console and Bing Webmaster Tools.