Secure all your subdomains with a single certificate.
A wildcard SSL certificate covers a domain and all its first-level subdomains. Instead of getting separate certificates for www.example.com, blog.example.com, and shop.example.com, a single *.example.com certificate secures them all.
Wildcards are particularly useful for architectures with many subdomains or dynamic subdomains created by users. They simplify management and reduce costs for paid certificates.
However, wildcards have important limitations to understand before adopting them. This guide explores the benefits, drawbacks, and best practices for using wildcard certificates.
Why choose a wildcard certificate:
What a wildcard cannot do:
Steps to get a wildcard with Let's Encrypt:
Commands for different scenarios:
#!/bin/bash
# Manual wildcard (you create DNS yourself)
certbot certonly --manual --preferred-challenges dns \
-d "*.example.com" -d example.com
# Automated wildcard with Cloudflare
apt install python3-certbot-dns-cloudflare
# Create /etc/letsencrypt/cloudflare.ini with:
# dns_cloudflare_api_token = YOUR_TOKEN
certbot certonly --dns-cloudflare \
--dns-cloudflare-credentials /etc/letsencrypt/cloudflare.ini \
-d "*.example.com" -d example.com
# Wildcard with Route53 (AWS)
apt install python3-certbot-dns-route53
certbot certonly --dns-route53 -d "*.example.com" -d example.com
# Verify wildcard certificate
openssl x509 -in /etc/letsencrypt/live/example.com/cert.pem -noout -text | grep DNS
For automation, use a DNS plugin. Manual mode requires intervention at each renewal.
Use wildcards effectively:
No, *.example.com covers sub.example.com but not deep.sub.example.com. For that, you'd need *.sub.example.com.
Yes, you can have *.example.com and *.other.com on the same server, or even *.sub.example.com in addition.
Yes, all Let's Encrypt certificates are free, including wildcards.
It's difficult. You could script DNS addition via your registrar's interface, but it's fragile. Prefer a registrar with API.
No, SSL performance is identical. The wildcard only has an additional entry in the Subject Alternative Name field.
For so few, individual certificates are simpler. Wildcards become advantageous from 5-10 subdomains or for dynamic subdomains.
Wildcard certificates are perfect for architectures with many subdomains. With DNS automation, renewal is as simple as a standard certificate.
Monitor your wildcard certificates with MoniTao. You'll be alerted before expiration and can react if automatic renewal fails.
Start free, no credit card required.