ERR_SSL_UNRECOGNIZED_NAME_ALERT: the server doesn't know this hostname

Chrome shows this when a server rejects the hostname sent during the TLS handshake (SNI). How to find the missing virtual host in nginx, Apache or your load balancer.

· 6 min read · By the Spot Downtime team

ERR_SSL_UNRECOGNIZED_NAME_ALERT means the server answered the start of the TLS handshake with an unrecognized_name alert. In plain terms: the browser said which hostname it wanted, and the server replied that it has nothing configured for that name. The connection ends before any certificate is exchanged, so this is not an expired or untrusted certificate. It is a routing problem on the server side.

Firefox reports a similar failure as SSL_ERROR_UNRECOGNIZED_NAME_ALERT. Visitors cannot fix it. Only the owner of the server, CDN or load balancer can.

What SNI does

One IP address often serves many HTTPS sites. For the server to pick the right certificate, the browser sends the hostname in the handshake itself, in a field called Server Name Indication (SNI). The server looks up that name in its configuration.

Most servers fall back to a default certificate when the name is unknown, which then produces a certificate mismatch such as ERR_CERT_COMMON_NAME_INVALID. Some are configured to refuse instead, and that refusal is the unrecognized_name alert you are seeing.

Reproduce it from the command line

openssl s_client lets you send any SNI name and see what the server does with it:

bash
# Ask for the hostname you expect
openssl s_client -connect 203.0.113.10:443 -servername www.example.com </dev/null

# Ask for a name the server should not know
openssl s_client -connect 203.0.113.10:443 -servername nonsense.invalid </dev/null

If the first command ends with a line like tlsv1 unrecognized name and no certificate, the server does not recognise www.example.com. If the first works and your browser fails, the browser is probably reaching a different server than you tested, which points at DNS.

TLS checkerCheck what a server negotiates for a hostname, including the protocol version and certificate it presents.

Common causes

The virtual host does not exist

You added the domain in DNS but never created the matching site on the server. This is the most common cause on a new setup. In nginx, make sure a server block lists the name:

nginx
server {
    listen 443 ssl;
    server_name example.com www.example.com;

    ssl_certificate     /etc/ssl/example.com/fullchain.pem;
    ssl_certificate_key /etc/ssl/example.com/privkey.pem;
}

Reload with nginx -t && systemctl reload nginx. In Apache, the equivalent is a VirtualHost with a ServerName or ServerAlias for the name:

apache
<VirtualHost *:443>
    ServerName example.com
    ServerAlias www.example.com
    SSLEngine on
    SSLCertificateFile    /etc/ssl/example.com/fullchain.pem
    SSLCertificateKeyFile /etc/ssl/example.com/privkey.pem
</VirtualHost>

A typo or a missing alias

The bare domain works, but www returns this error, or the other way round. Compare the failing hostname character by character with the names in server_name or ServerAlias.

DNS points to the wrong server

The record may still point at an old host that has no configuration for your domain, or at a shared server that hosts someone else's sites. Resolve the name and compare the address with your real origin. During a migration, some visitors will get the new server and some the old one until DNS propagation finishes.

bash
dig +short www.example.com A
dig +short www.example.com CNAME

The load balancer or CDN has no matching listener or domain

On hosted platforms and CDNs, a custom domain has to be added to the service as well as to DNS. If it is missing, or the domain was removed from the project, the edge server rejects the name. Check the custom domains list of the service and make sure the domain shows as verified or active.

A certificate was issued for the wrong names

Some platforms refuse a name until a certificate covering it is attached. If a certificate for the domain was never issued, or issuance failed, the name stays unrecognised. See Let's Encrypt renewal failed for why issuance breaks.

Connecting by IP address

Requesting https://203.0.113.10/ sends no hostname at all, or one the server does not know. Some configurations reject this on purpose. Always test with the real hostname.

Not the same as a mismatch error

A mismatch error means the server answered with a certificate for the wrong name. This one means the server refused to answer for the name. They look similar to visitors but are fixed in different places: mismatch is about which certificate is attached, while unrecognised name is about which hostnames the server accepts at all.

A fix checklist

  1. Run openssl s_client with -servername against the server IP you expect.
  2. If it refuses, add or correct the virtual host, server_name or custom domain entry.
  3. If it works, check that DNS for the name really points at that server, and for every record, including AAAA.
  4. Reload the service and test again, then open the page in a private window.
  5. Check each name you serve, including www and any subdomains.
  • An AAAA record to an old IPv6 address is easy to miss, because many people only test over IPv4.
  • If you recently moved DNS providers, make sure every record was copied across. See changing nameservers without downtime.

Monitor every hostname you serve

This error shows up when a hostname is added, moved or removed, and it only affects the names that are misconfigured. A site can look fine at its main address while a subdomain is broken. Add a website monitor for each public hostname, and use SSL monitoring so certificate problems on HTTPS checks are reported too. Spot Downtime counts TLS errors as down, and confirms from other regions before alerting.

Get new guides by email

Practical posts on monitoring, outages, error fixes and on-call, when they're published. No spam.

Unsubscribe from any email with one click. See our privacy policy.

Keep reading