What Is a Wildcard SSL Certificate?
A wildcard SSL certificate secures a domain and all its direct subdomains with one certificate. How they work, why they stop at one level, and when to use one.
ProfitTool Team
Security & Dev
What a Wildcard Certificate Is
A wildcard SSL/TLS certificate secures a domain and its direct subdomains with a single certificate, using an asterisk as the leftmost label:
*.example.comOne certificate, one private key, one renewal — covering every subdomain one level below example.com, including subdomains that did not exist when the certificate was issued.
Exactly What It Covers
Wildcard matching is defined by RFC 6125 and enforced by browsers. The asterisk replaces exactly one label, and only the leftmost one.
| Hostname | Covered by *.example.com? | Why |
|---|---|---|
www.example.com | Yes | One label in the wildcard position |
api.example.com | Yes | One label in the wildcard position |
staging-2.example.com | Yes | Hyphens and digits are part of a single label |
example.com | No | No label at all in the wildcard position |
sub.api.example.com | No | Two labels — the asterisk matches one |
example.com.au | No | Different domain entirely |
www.example.org | No | Wildcards never cross the registered domain |
The two rows that catch people out are the bare domain and the multi-level subdomain. Both are covered below.
The Bare Domain Problem
*.example.com does not match example.com. This surprises almost everyone the first time, and it produces a hard browser error on the apex:
NET::ERR_CERT_COMMON_NAME_INVALIDThe fix is to include both names in the certificate's Subject Alternative Name (SAN) list:
DNS:*.example.com
DNS:example.comPractically every CA issues this pair as a matter of course, and Let's Encrypt does it when you request both names. If you inherited a certificate that fails on the apex, check the SAN list before assuming the certificate is broken — it is more likely incomplete.
The Multi-Level Problem
*.example.com does not cover sub.api.example.com. A second wildcard entry is required:
DNS:*.example.com
DNS:*.api.example.comCertificates with a wildcard in a position other than the leftmost label — www.*.example.com, *.*.example.com — are not accepted by browsers. If you need arbitrary depth, you need one wildcard entry per level you intend to serve.
Public Suffix Restriction
No CA will issue *.com, *.co.uk, or a wildcard on any entry in the Public Suffix List. A wildcard must sit below a registrable domain that you control.
Wildcard vs the Alternatives
| Option | Covers | Best when |
|---|---|---|
| Single-name certificate | One exact hostname | You have one or two stable hostnames |
| Wildcard | All direct subdomains of one domain | Subdomains are numerous, or created dynamically |
| Multi-domain (SAN / UCC) | An explicit list of unrelated names | You serve several distinct domains from one endpoint |
| Wildcard + multi-domain | Multiple domains, each with subdomains | Large multi-brand estates |
A wildcard cannot cover a second registered domain. *.example.com will never serve example.net — that requires additional SAN entries or a separate certificate.
Advantages
- One renewal instead of many. A single expiry date to monitor rather than one per subdomain.
- New subdomains work immediately. Spin up
feature-42.example.comand it is already covered — no issuance, no ACME round trip, no wait. - Fewer moving parts in automation. One certificate to distribute to load balancers and origin servers.
- Subdomain names stay out of Certificate Transparency logs. Every non-wildcard certificate is published to public CT logs, which means issuing
admin.example.comannounces that hostname to anyone watching. A wildcard publishes only*.example.com. This is a real, if modest, reduction in reconnaissance surface — it is not a security control, because subdomains are discoverable by other means, but it does close one easy channel.
Limitations and Risks
- One key compromises everything. The blast radius of a stolen private key is every subdomain the wildcard covers, not one hostname. This is the central trade-off.
- The key must exist wherever the certificate is served. If ten teams each run their own subdomain on their own infrastructure, a wildcard means distributing one private key to ten places. Each copy is another chance to leak it.
- Revocation is all-or-nothing. Revoking a compromised wildcard invalidates every subdomain at once. With per-host certificates you revoke one and the rest keep serving.
- No apex coverage without an explicit SAN, as above.
- Some environments restrict them. Certain managed platforms and internal PKI policies disallow wildcards outright.
Free Wildcards with Let's Encrypt
Let's Encrypt issues wildcard certificates through ACMEv2, with one important constraint: wildcard issuance requires the DNS-01 challenge. The HTTP-01 challenge used for ordinary certificates is not accepted for wildcards, because serving a file over HTTP proves control of one host, not of the whole namespace below the domain.
The DNS-01 flow:
- Your ACME client requests a certificate for
*.example.com. - Let's Encrypt returns a token.
- The client creates a TXT record at
_acme-challenge.example.comcontaining a value derived from that token. - Let's Encrypt queries that TXT record from the public DNS system.
- On a match, the certificate is issued and the TXT record can be removed.
Step 3 is why wildcards need more setup than standard certificates: something must write a DNS record automatically. Certbot and acme.sh both ship DNS plugins for the major providers, which authenticate to the provider's API and manage the record for you:
certbot certonly \
--dns-cloudflare \
--dns-cloudflare-credentials ~/.secrets/cloudflare.ini \
-d 'example.com' -d '*.example.com'Note that both names are requested — the apex and the wildcard — so the resulting certificate covers example.com as well.
Practical points worth knowing before you automate this:
- Renewal repeats the DNS challenge. Certificates last 90 days, so whatever writes the TXT record must keep working unattended. A manual DNS edit at issuance time creates a certificate that silently fails to renew.
- Two names in one order need two TXT records. Requesting the apex and the wildcard together produces two challenges at the same
_acme-challenge.example.comname. The DNS provider must support multiple TXT values on one name; nearly all do, but some caching layers do not return both. - Propagation delay causes most failures. If validation runs before the TXT record is visible to Let's Encrypt's resolvers, the order fails. Most plugins expose a wait interval for exactly this reason.
- Rate limits apply per registered domain. Repeated failed attempts while debugging count against the limit, so test against the staging endpoint first.
When to Use a Wildcard — and When Not To
Use one when:
- You have many subdomains, or create them dynamically (per-customer, per-branch, per-environment).
- All covered subdomains terminate TLS on infrastructure under the same operational control.
- You have a real answer to "where does the private key live, and who can read it?"
Avoid one when:
- Subdomains run on infrastructure you do not control, or that different teams administer with different security postures.
- You need compartmentalisation — the ability to revoke or rotate one service without touching the others.
- A third party (a SaaS vendor hosting
status.example.com, for instance) would need a copy of the key. Give them their own certificate instead.
The rule of thumb: a wildcard is a convenience decision with a security cost, and the cost scales with how many separate places the private key ends up.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
Apex domain shows ERR_CERT_COMMON_NAME_INVALID | Certificate has *.example.com but not example.com | Reissue with both names in the SAN list |
| Deep subdomain fails, direct subdomains work | Wildcard matches one label only | Add *.sub.example.com as a second entry |
| Certificate valid in one browser, not another | Stale intermediate chain, not the wildcard itself | Serve the full chain from the server |
| ACME order fails with "no valid AAAA/A" or DNS errors | TXT record not yet visible to the CA | Increase propagation wait; confirm the record resolves publicly |
| Renewal works manually but not from cron | DNS plugin credentials unavailable in the cron environment | Use absolute paths and an explicit credentials file |
Frequently Asked Questions
Does a wildcard certificate slow down TLS handshakes? No. Certificate coverage has no effect on handshake performance. Chain length and key algorithm do.
Can I use one wildcard certificate on several servers? Technically yes — the certificate and its key can be installed anywhere. Whether you should depends entirely on whether you trust every one of those servers with the key.
Do wildcards work for email and other TLS services? Yes. A wildcard is an X.509 certificate like any other and can secure SMTP, IMAP, or any service on a covered hostname.
Is a wildcard less trusted by browsers? No. Validation level (DV, OV, EV) is independent of wildcard coverage, and browsers treat a DV wildcard exactly as they treat a DV single-name certificate.
Verify which names a certificate actually covers, and how long it has left, with the SSL Certificate Checker. To confirm the DNS-01 TXT record has propagated before an ACME run, use the DNS Lookup tool. For monitoring expiry across an estate, see How to Check SSL Certificate Expiry.
ProfitTool Team
Security & DevWritten and maintained by the ProfitTool team. Where an article references a ProfitTool utility, the behaviour described is the behaviour of the tool on this site — you can open it and check the output yourself.
Try the Interactive Tools Mentioned
Free to use with no ProfitTool signup. Data handling varies by tool.
More from the Knowledge Hub
How to Check SSL Certificate Expiry: 5 Methods
An expired SSL certificate blocks all users with a hard browser warning. Here are five ways to check certificate expiry before it becomes a problem.
Privacy & SecuritySSL vs TLS: What Is the Difference?
SSL and TLS are both protocols for encrypting internet connections, but they are not the same. This guide explains the history, the differences, and why only TLS should be used today.
Privacy & SecurityWhat Is an SSL Certificate and How Does It Work?
SSL certificates authenticate websites and encrypt data in transit. This guide explains what a certificate contains, how TLS handshakes work, and what to check before your certificate expires.