Automating Wildcard SSL with Certbot and RFC 2136
Configure the official EFF Certbot client with the certbot-dns-rfc2136 plugin. Issue and auto-renew Let's Encrypt wildcard (*.example.com) and apex certificates with zero downtime and rapid DNS-01 verification (typically 0.2–5s).
📋 Prerequisites
- An active domain on OnlyDNS.
- A TSIG Key generated in the OnlyDNS Portal or via CLI (
onlydns tsig create --algo hmac-sha256). - Root or
sudoaccess on your Linux/UNIX server.
Install Certbot & RFC 2136 Plugin
Install Certbot along with its official RFC 2136 DNS plugin using your distribution's package manager:
Create TSIG Credentials File
Create a credentials file at /etc/letsencrypt/rfc2136.ini containing your TSIG key and OnlyDNS primary Anycast nameserver:
🔒 Mandatory Security Step: Restrict file permissions so only root can read your TSIG secret:
sudo chmod 600 /etc/letsencrypt/rfc2136.ini
_acme_challenge subdomain. This ensures Certbot can only modify challenge validation records without write access to root records or other subdomains.
Request Your Wildcard SSL Certificate
Run Certbot to request a certificate covering both the apex domain (example.com) and all subdomains (*.example.com). Because OnlyDNS synchronizes edge nodes rapidly (typically 0.2 to 5 seconds), a propagation delay of 10 seconds is optimal:
Certbot will output the paths to your freshly issued certificate files:
- Certificate:
/etc/letsencrypt/live/example.com/fullchain.pem - Private Key:
/etc/letsencrypt/live/example.com/privkey.pem
Automate Renewals & Web Server Reloads
Certbot automatically installs a systemd timer or cron job that runs twice daily. Verify that automatic renewal will succeed by running a dry run:
To automatically reload Nginx or Apache whenever a certificate is renewed, add a deploy hook script under /etc/letsencrypt/renewal-hooks/deploy/reload-webserver.sh:
sudo chmod +x /etc/letsencrypt/renewal-hooks/deploy/reload-webserver.sh