Certbot ACME Integration with OpusDNS
Let Certbot create and remove DNS TXT records automatically via the OpusDNS API
Certbot is one of the most widely used ACME clients. It obtains and renews HTTPS certificates from Let's Encrypt and other ACME certificate authorities.
The plugin certbot-dns-opusdns connects Certbot to the OpusDNS API for DNS-01 validation. It creates the TXT records required for validation automatically, checks that they are visible in public DNS and removes them afterwards. This also works for wildcard certificates. Background on certificates and ACME: What Are SSL Certificates, and How Does ACME Work?
Repository: github.com/OpusDNS/certbot-dns-opusdns
Requirements
- Python 3.10 or later, with Certbot and the plugin installed in the same Python environment. The Snap version of Certbot can't load this plugin.
- The domain's DNS zone is hosted at OpusDNS.
- An OpusDNS API key. Create it under Developer > API Credentials, see Creating API Credentials.
Setup
- Install the plugin:
pip install certbot-dns-opusdns
- Create the credentials file
~/.secrets/certbot/opusdns.iniwith your API key:dns_opusdns_api_key = opk_...
Protect the file so that only you can read it:chmod 600 ~/.secrets/certbot/opusdns.ini
- Request the certificate:
certbot certonly \ --authenticator dns-opusdns \ --dns-opusdns-credentials ~/.secrets/certbot/opusdns.ini \ --dns-opusdns-propagation-seconds 60 \ -d example.com \ -d "*.example.com"
For tests with the OpusDNS sandbox, add dns_opusdns_api_endpoint = https://sandbox.opusdns.com to the credentials file and use a sandbox API key.
Renewal
Certbot renews certificates with certbot renew. If you installed Certbot with pip, no automatic renewal is set up: schedule certbot renew yourself, for example daily with cron or a systemd timer. Certbot then renews the certificates that are due and uses the OpusDNS plugin again for validation.
Troubleshooting
- No OpusDNS zone found for domain: check that the zone exists in your OpusDNS account.
- Invalid API key: check the key in the credentials file (no extra spaces) and its permissions under Developer > API Credentials.
- DNS propagation timeout: increase
--dns-opusdns-propagation-seconds, for example to 120, and check that the domain uses the OpusDNS nameservers.
.jpg?width=670&height=174&name=Knowledge%20Banner_%20Github%20Dark%20(1).jpg)