What a Wildcard Covers
- Covered: any single label in place of the asterisk, such as
www.example.com,shop.example.com, orapi.example.com. - Not covered: the bare domain
example.com. Request it as a second name on the same certificate. - Not covered: two levels down, such as
a.b.example.com. That needs its own name or a wildcard for*.b.example.com.
If you only have a few names, a normal certificate that lists each of them, as in Certbot with Nginx, is simpler and works over port 80.
How the DNS-01 Challenge Works
- Certbot asks Let's Encrypt for a certificate and receives a token for each name.
- A TXT record named
_acme-challenge.example.comis published with a value derived from the token. - Let's Encrypt looks up the record from several places on the internet.
- If the value matches, the certificate is issued, and the record can be removed.
When you request both example.com and *.example.com, both checks use the same record name, so two TXT values exist under it at the same time. Keep both. No port on the server has to be open for DNS-01, which also makes it useful for servers that are not reachable from the internet.
The Manual Method and Its Limit
sudo certbot certonly --manual --preferred-challenges dns -d example.com -d '*.example.com' --email YOUR_EMAILQuote the asterisk so the shell does not expand it. Certbot prints the TXT value, waits while you add it in your DNS panel, and continues when you press Enter. Check that the record is visible before you do:
dig +short TXT _acme-challenge.example.comThe limit: a manual certificate does not renew by itself. The renewal timer cannot type into your DNS panel, so certbot renew fails for it unless you wrote an authentication hook script, and the certificate expires unless you repeat the steps by hand each time. With Let's Encrypt lifetimes at 90 days today and set to shrink to 64 days in February 2027 and 45 days in February 2028, use the manual method only for a test.
Use a DNS Plugin
DNS plugins create and remove the TXT record through your DNS provider's API. Plugins exist for many providers, and the RFC 2136 plugin works with your own BIND or similar name server. The example uses the Cloudflare plugin. On Ubuntu and Debian:
sudo apt install python3-certbot-dns-cloudflareOn AlmaLinux and Rocky Linux, from EPEL:
sudo dnf install python3-certbot-dns-cloudflareWith the Certbot snap:
sudo snap set certbot trust-plugin-with-root=ok
sudo snap install certbot-dns-cloudflareStore the API Token Safely
Create an API token in the Cloudflare dashboard with the Zone, DNS, Edit permission for this one zone only. Put it in a file that only root can read:
sudo mkdir -p /root/.secrets
sudo nano /root/.secrets/cloudflare.inidns_cloudflare_api_token = YOUR_API_TOKENsudo chmod 600 /root/.secrets/cloudflare.iniCertbot warns about unsafe permissions on every run while other users can read the file. Anyone with this token can change your DNS, so keep it out of chats, tickets, and version control.
Request the Certificate
sudo certbot certonly --dns-cloudflare \
--dns-cloudflare-credentials /root/.secrets/cloudflare.ini \
-d example.com -d '*.example.com' \
--email YOUR_EMAIL \
--deploy-hook "systemctl reload nginx"The files land in /etc/letsencrypt/live/example.com/. Because certonly does not touch the web server, point every HTTPS server block at them with ssl_ and ssl_. The deploy hook reloads Nginx after each renewal. Check any subdomain afterward with openssl s_
Test the Renewal
sudo certbot renew --dry-runIf the dry run fails with a TXT record that was not found, the provider may need more time to publish records. The Cloudflare plugin waits 10 seconds by default; add, for example, --dns-cloudflare-propagation-seconds 60 when you request the certificate, and Certbot stores it for renewals. Timers and hooks are covered in how to renew Let's Encrypt certificates.
Delegate the Challenge Record
If your main DNS provider has no API, add a CNAME for _acme-challenge.example.com that points to a name in a zone you can automate. Let's Encrypt follows the CNAME, and your main DNS stays as it is. The client must then write the TXT record in that other zone, so use a hook script or a tool built for delegated validation.
Updated:
Linux VPS with Full Root Access
MUVCloud cloud servers run on KVM with Enterprise NVMe SSD storage and full root access, in Turkey, the Netherlands, and the USA.
More Guides
No Limits on Service or Support
You are not on your own as your projects grow. Our support engineers are ready 24/7, on several channels, whenever you need them.

- 100% customer satisfaction goal
- Our own hardware
- 24/7 ticket and email support
- 4 countries with locations