OpusDNS DNS Authenticator plugin for Certbot
Project description
certbot-dns-opusdns
OpusDNS DNS Authenticator plugin for Certbot.
This plugin enables automatic DNS-01 challenge verification for Let's Encrypt certificates using OpusDNS as your DNS provider.
Features
- Automatic DNS-01 challenge record management
- DNS propagation polling (verifies records via 8.8.8.8 and 1.1.1.1)
- Retry logic for rate limits and transient errors
- Support for wildcard certificates
- Configurable API endpoint (production/sandbox)
- Best-effort cleanup (doesn't fail on cleanup errors)
Installation
From PyPI (recommended)
pip install certbot-dns-opusdns
From source
git clone https://github.com/OpusDNS/certbot-dns-opusdns
cd certbot-dns-opusdns
pip install .
Docker
docker build -t certbot-dns-opusdns .
Prerequisites
- Python 3.10+
- OpusDNS Account: Sign up at opusdns.com
- API Key: Create an API key via the OpusDNS dashboard
- DNS Zone: Your domain must be managed by OpusDNS
Configuration
Credentials File
Create a credentials file (e.g., ~/.secrets/certbot/opusdns.ini):
# Required: Your OpusDNS API key
dns_opusdns_api_key = opk_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxx
# Optional: API endpoint (defaults to https://api.opusdns.com)
# dns_opusdns_api_endpoint = https://api.opusdns.com
# Optional: TTL for TXT records in seconds (defaults to 60)
# dns_opusdns_ttl = 60
Important: Protect your credentials file:
mkdir -p ~/.secrets/certbot
chmod 700 ~/.secrets/certbot
chmod 600 ~/.secrets/certbot/opusdns.ini
Usage
Basic Certificate (Single Domain)
certbot certonly \
--authenticator dns-opusdns \
--dns-opusdns-credentials ~/.secrets/certbot/opusdns.ini \
--dns-opusdns-propagation-seconds 60 \
-d example.com
Wildcard Certificate
certbot certonly \
--authenticator dns-opusdns \
--dns-opusdns-credentials ~/.secrets/certbot/opusdns.ini \
--dns-opusdns-propagation-seconds 60 \
-d example.com \
-d "*.example.com"
Multiple Domains
certbot certonly \
--authenticator dns-opusdns \
--dns-opusdns-credentials ~/.secrets/certbot/opusdns.ini \
-d example.com \
-d www.example.com \
-d api.example.com
Sandbox/Testing Environment
For testing with OpusDNS sandbox:
# opusdns.ini
dns_opusdns_api_key = opk_sandbox_key_here
dns_opusdns_api_endpoint = https://sandbox.opusdns.com
certbot certonly \
--authenticator dns-opusdns \
--dns-opusdns-credentials opusdns.ini \
--server https://acme-staging-v02.api.letsencrypt.org/directory \
-d example.com
Docker Usage
Using docker-compose
-
Copy example files:
cp .env.example .env cp opusdns.ini.example credentials/opusdns.ini
-
Edit
.envandcredentials/opusdns.iniwith your values -
Run certbot:
docker-compose up certbot
Manual Docker
docker run -it --rm \
-v $(pwd)/letsencrypt:/etc/letsencrypt \
-v $(pwd)/credentials:/credentials:ro \
certbot-dns-opusdns \
certonly \
--authenticator dns-opusdns \
--dns-opusdns-credentials /credentials/opusdns.ini \
-d example.com
Command-Line Options
| Option | Description | Default |
|---|---|---|
--dns-opusdns-credentials |
Path to credentials INI file | Required |
--dns-opusdns-propagation-seconds |
Time to wait for DNS propagation | 60 |
How It Works
- Zone Detection: Iterates through domain parts to find the matching OpusDNS zone via
GET /v1/dns/{candidate} - Record Creation: Creates
_acme-challengeTXT record viaPATCH /v1/dns/{zone}/records(upsert operation) - DNS Propagation Polling: Polls public DNS resolvers (8.8.8.8, 1.1.1.1) to verify record propagation
- Validation: Let's Encrypt validates the challenge
- Cleanup: Removes the challenge record (best-effort, logs errors)
API Details
Authentication
- Header:
X-Api-Key: opk_...
Endpoints Used
GET /v1/dns/{zone}— Zone lookup for zone detectionPATCH /v1/dns/{zone}/records— Create/remove TXT records
Error Handling
- 401 Unauthorized: Invalid API key
- 404 Not Found: Zone doesn't exist in your account
- 429 Rate Limit: Automatic retry with exponential backoff (max 3 attempts)
- 5xx Server Error: Automatic retry with backoff
Troubleshooting
"No OpusDNS zone found for domain"
- Ensure your domain is added to OpusDNS
- Check that the zone name matches (e.g.,
example.comforwww.example.com)
"Invalid API key"
- Verify API key format:
opk_{26 chars}_{30 chars}_{6 chars} - Check API key permissions in OpusDNS dashboard
- Ensure no extra whitespace in credentials file
"DNS propagation timeout"
- Increase
--dns-opusdns-propagation-seconds(e.g., 120) - Check OpusDNS dashboard for zone status
- Verify nameservers are correctly configured
"Rate limit exceeded"
- OpusDNS has API rate limits
- Plugin automatically retries with backoff
- Reduce concurrent certificate requests
Development
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest -v
# Run tests with coverage
pytest --cov=certbot_dns_opusdns --cov-report=html
# Lint
ruff check certbot_dns_opusdns tests
# Type check
mypy certbot_dns_opusdns
Contributing
See CONTRIBUTING.md for development setup and guidelines.
License
MIT License — See LICENSE file.
Support
- Issues: GitHub Issues
- Documentation: OpusDNS Docs
- Email: support@opusdns.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file certbot_dns_opusdns-1.0.0.tar.gz.
File metadata
- Download URL: certbot_dns_opusdns-1.0.0.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f55adabec42cd8e6bf3aa401eca6dbc281c380f9c53f4b2a515ba85d5f3a8e15
|
|
| MD5 |
65e5bd8390c8ec5cfbb4a11e4825ca79
|
|
| BLAKE2b-256 |
c238da7788be59ca9f3da41b9d182a977c2e886c8650985f2e3434461a75456f
|
Provenance
The following attestation bundles were made for certbot_dns_opusdns-1.0.0.tar.gz:
Publisher:
release.yml on OpusDNS/certbot-dns-opusdns
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
certbot_dns_opusdns-1.0.0.tar.gz -
Subject digest:
f55adabec42cd8e6bf3aa401eca6dbc281c380f9c53f4b2a515ba85d5f3a8e15 - Sigstore transparency entry: 1629984470
- Sigstore integration time:
-
Permalink:
OpusDNS/certbot-dns-opusdns@5d1a7d97d6a3561774167faf0644236f9a90cd9c -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/OpusDNS
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5d1a7d97d6a3561774167faf0644236f9a90cd9c -
Trigger Event:
push
-
Statement type:
File details
Details for the file certbot_dns_opusdns-1.0.0-py3-none-any.whl.
File metadata
- Download URL: certbot_dns_opusdns-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0347661ce22980c1e2f3246a9bb48f289476aa1163e2fc04f2831274af02ea00
|
|
| MD5 |
663ac1f07b7178a7dfafbdb504a945e5
|
|
| BLAKE2b-256 |
6c227555b0c8478e435288620f56a901a37481bfb4ff1b1110c529e6cc6821d9
|
Provenance
The following attestation bundles were made for certbot_dns_opusdns-1.0.0-py3-none-any.whl:
Publisher:
release.yml on OpusDNS/certbot-dns-opusdns
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
certbot_dns_opusdns-1.0.0-py3-none-any.whl -
Subject digest:
0347661ce22980c1e2f3246a9bb48f289476aa1163e2fc04f2831274af02ea00 - Sigstore transparency entry: 1629984498
- Sigstore integration time:
-
Permalink:
OpusDNS/certbot-dns-opusdns@5d1a7d97d6a3561774167faf0644236f9a90cd9c -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/OpusDNS
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5d1a7d97d6a3561774167faf0644236f9a90cd9c -
Trigger Event:
push
-
Statement type: