Skip to main content

certbot-dns-beget-plugin

CI

EN | RU

A Certbot plugin that obtains Let's Encrypt certificates using the DNS challenge (dns-01) for domains served by Beget DNS. The _acme-challenge TXT record is created and removed automatically through the Beget API.

The DNS challenge lets you obtain wildcard certificates (*.example.com) and does not require port 80 to be open.

Installation

The plugin must be installed into the same Python environment as Certbot.

pip install certbot-dns-beget-plugin

If Certbot was installed into a virtual environment, as in the EFF pip instructions, use that environment's pip:

sudo /opt/certbot/bin/pip install certbot-dns-beget-plugin

Note: Certbot installed with snap does not see plugins installed with pip: snap plugins have to be packaged as separate snaps. The same goes for Certbot from distribution packages (apt, dnf): modern distributions do not let pip install into the system Python. In both cases, install Certbot with pip into a virtual environment using the instructions above.

The latest development version can be installed straight from GitHub:

pip install git+https://github.com/l1n-x/certbot-dns-beget-plugin

Check that Certbot sees the plugin:

certbot plugins
# * dns-beget-plugin
# Description: Obtain certificates using a DNS TXT record (if you are using Beget for DNS).

Configuration

  1. In the Beget control panel, open the API section, enable API access and set an API password.

  2. Create a credentials file, for example /etc/letsencrypt/beget.ini:

    dns_beget_plugin_username = your_beget_login
    dns_beget_plugin_password = your_api_password
    
  3. Restrict access to the file:

    chmod 600 /etc/letsencrypt/beget.ini
    

Usage

certbot certonly \
  --authenticator dns-beget-plugin \
  --dns-beget-plugin-credentials /etc/letsencrypt/beget.ini \
  -d example.com \
  -d '*.example.com'
Option Description
--dns-beget-plugin-credentials Path to the INI file with credentials (required).
--dns-beget-plugin-propagation-seconds Seconds to wait for the DNS record to propagate before validation. Default: 120.

Renewal

Certbot saves the plugin options in /etc/letsencrypt/renewal/<domain>.conf, so certbot renew uses the same plugin and credentials file without extra arguments:

authenticator = dns-beget-plugin
dns_beget_plugin_credentials = /etc/letsencrypt/beget.ini

Keep the credentials file at the path given when the certificate was obtained. Check that renewal works:

sudo certbot renew --dry-run

If Certbot is installed in /opt/certbot as in the EFF pip instructions, renewal is not scheduled automatically. Add a cron job that tries twice a day at a random minute:

echo "0 0,12 * * * root /opt/certbot/bin/python -c 'import random; import time; time.sleep(random.random() * 3600)' && /opt/certbot/bin/certbot renew -q" | sudo tee -a /etc/crontab > /dev/null

To reload the web server after a certificate is renewed, put a script into /etc/letsencrypt/renewal-hooks/deploy/:

sudo tee /etc/letsencrypt/renewal-hooks/deploy/reload-nginx.sh > /dev/null <<'SH'
#!/bin/sh
systemctl reload nginx
SH
sudo chmod +x /etc/letsencrypt/renewal-hooks/deploy/reload-nginx.sh

How it works

  • If the _acme-challenge.<domain> subdomain does not exist on the account, the plugin creates it and deletes it, together with its records, after validation.
  • If the subdomain already exists, the plugin adds a TXT record to it and removes only that record after validation. Existing A, AAAA, MX and TXT records are preserved, although the Beget API resets their TTL to 600 seconds.
  • The plugin refuses to change records if the name is delegated via NS or CNAME, or if it has records of other types that the Beget API cannot preserve.

Limitations

  • New records usually appear on the Beget name servers within a minute, so the default 120-second wait leaves some margin. If validation fails because the record is not found, increase --dns-beget-plugin-propagation-seconds.
  • The Beget API can only replace all records of a name at once. Do not run several Certbot processes for the same domain at the same time: they can overwrite each other's TXT records, and validation will fail.

Development

See CONTRIBUTING.md for setting up the project, running the tests and releasing.

Acknowledgements

Based on certbot-dns-beget-api by Medan-rfz (MIT License).

License

MIT

Metadata

Release files for certbot-dns-beget-plugin 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for certbot-dns-beget-plugin 1.0.0
File Size Uploaded Provenance
certbot_dns_beget_plugin-1.0.0.tar.gz 9.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for certbot-dns-beget-plugin 1.0.0
File Interpreter ABI Platform
certbot_dns_beget_plugin-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.3 kB

Release files / certbot_dns_beget_plugin-1.0.0.tar.gz

Download URL certbot_dns_beget_plugin-1.0.0.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7f98859bf0c5200d365861c814018f47cdc282d346ed0909c443e0c93c6f7922
BLAKE2b-256 checksum
How to use checksums
7efc605de5ce6478db0a2d32291aab6c02dca27e0cb9ba860057deef7177f825
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Release files / certbot_dns_beget_plugin-1.0.0-py3-none-any.whl

Download URL certbot_dns_beget_plugin-1.0.0-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a8d19743ec4a08e4357a6cd38326b1c8562ef6ae2da882f7dd647fec6f990662
BLAKE2b-256 checksum
How to use checksums
4a78af7986e89632d1215db40649060bfb88b81987fb74e522deb4573a6b274a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Security for certbot-dns-beget-plugin 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for certbot_dns_beget_plugin-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page