Automating Wildcard SSL with acme.sh and RFC 2136
Deploy certificates effortlessly using acme.sh and its native dns_nsupdate engine. Lightweight, dependency-free, and fully automated with OnlyDNS rapid Anycast DNS propagation (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). - Standard Linux/BSD shell environment with
curlorwgetandnsupdate(part ofbind9-dnsutils/bind-utils).
Install acme.sh
Install acme.sh into your user home directory (~/.acme.sh) with your notification email:
Ensure nsupdate is installed on your host: sudo apt install dnsutils (Debian/Ubuntu) or sudo dnf install bind-utils (RHEL/CentOS).
Configure OnlyDNS TSIG Environment Variables
acme.sh automatically persists these variables securely inside ~/.acme.sh/account.conf so you only need to export them once:
_acme_challenge subdomain so acme.sh cannot modify other zone records.
Issue Wildcard SSL Certificate
Request your certificate with --dns dns_nsupdate. Set --dnssleep 10 because OnlyDNS updates propagate rapidly across edge nodes (typically 0.2–5s):
--server letsencrypt to the command.
Install Certificate & Enable Auto-Renewal
Do not directly reference files inside ~/.acme.sh/ in your web server config. Use --install-cert to copy them to your production directory and configure your reload daemon:
acme.sh maintains an active cron job (crontab -l) that checks certificate expiration daily and triggers automatic renewal and reload without human intervention.