certbot-dns-nameocean
A Certbot DNS authenticator for NameOcean DNS. It answers the ACME dns-01 challenge by adding a TXT record through NameOcean's API and removes it afterwards, so you can get wildcard certificates and certificates for servers that are not reachable from the internet.
Install
pip install certbot-dns-nameocean
Certbot must be installed with pip in the same environment (the snap and distribution packages can't load pip plugins).
Credentials
Create an API key with the dns:read and dns:write scopes in the dashboard. It can be limited to the domains Certbot manages and to your server's IP addresses. The domain's zone must be on NameOcean DNS in the same account.
Put it in an INI file that only you can read:
# ~/.secrets/certbot/nameocean.ini
dns_nameocean_api_key = no_live_...
chmod 600 ~/.secrets/certbot/nameocean.ini
Without --dns-nameocean-credentials, the NAMEOCEAN_API_KEY environment variable is used.
Usage
certbot certonly \
--authenticator dns-nameocean \
--dns-nameocean-credentials ~/.secrets/certbot/nameocean.ini \
-d example.com -d '*.example.com'
| Option | Default | |
|---|---|---|
--dns-nameocean-credentials |
(none) | INI file with dns_nameocean_api_key |
--dns-nameocean-propagation-seconds |
20 | Seconds to wait before Let's Encrypt checks the record |
Renewals (certbot renew) reuse the same settings.
How it works
- The zone is the longest of your NameOcean zones that the name ends with, so
_acme-challenge.app.example.comgoes intoexample.com(or intoapp.example.comif that is its own zone). - Each challenge value is its own TXT record with a 5 minute TTL; existing TXT records are left alone, so an apex and its wildcard can be issued together.
- Cleanup deletes only the records this run added (or, after a restart, the TXT record with exactly that value).
Development
pip install -e '.[dev]'
pytest
Releases: bump version in pyproject.toml, then git tag vX.Y.Z && git push --tags; GitHub Actions tests, builds and publishes to PyPI (trusted publishing).
License
MIT