SAN and hostname matching — a wildcard covers exactly one label
The short answer
Browsers compare the hostname you connected to with the SAN (Subject Alternative Name) DNS entries in the certificate. CN (Common Name) was the older fallback and is already deprecated by the CA/Browser Forum Baseline Requirements.
Wildcard rules
A wildcard starts with *. and replaces exactly one left-most label. A different label count never matches.
| SAN | Host | Result |
|---|---|---|
| *.example.com | a.example.com | match |
| *.example.com | a.b.example.com | no match (two labels) |
| *.example.com | example.com | no match (empty label) |
| *.example.com | A.EXAMPLE.COM | match (case-insensitive) |
| app.example.com | app.example.com | match |
| *.example.com | app.example.co | no match |
A wildcard cannot cover a whole top-level domain (*) or sit in the middle (a.*.example.com). Public CAs do not issue such certificates and browsers reject them.
IP addresses need an IP SAN
When you connect by IP, the check uses the iPAddress entry, not a DNS entry. IPv4 is stored as 4 bytes and IPv6 as 16. Writing an IP into a DNS name does not make it valid for IP connections.
Certificates without SAN
Very old certificates may carry only a CN. This tool falls back to CN only in that case and notes that modern browsers ignore CN. In practice the right fix is to reissue with a SAN.
Internationalised domains
Korean, Japanese and Chinese domain names are converted to punycode (xn--) in the SAN. Browsers compare the converted form, so use punycode when you test matching.
Common myths
- “The domain is in the CN, so it is fine” — when a SAN exists, CN is ignored.
- “*.example.com covers example.com” — it does not; the empty label is not replaced.
- “It covers any subdomain” — only one label.
- “The IP is written in the certificate, so IP access works” — it must be an IP SAN.
The hostname check here is a SAN string comparison. A real connection also validates chain, expiry and revocation.
Questions
Can a SAN hold several domains?
Yes. One certificate can carry many DNS names and IPs. More names mean more management and a wider blast radius, so include only what you need.
Are wildcard certificates safe?
They are convenient, but one key protects every subdomain, so a leak has a wide impact. Consider separate certificates for sensitive subdomains.
How is a trailing dot handled?
Under DNS normalisation a trailing dot is the same name. This tool strips it before comparing.
Enter a domain to see which SAN entry matches and why.
Open the checkerThis article follows RFC 5280 and the CA/Browser Forum Baseline Requirements.