Package: certbot-dns-duckdns
Certbot DNS DuckDNS PluginPlugin for certbot for a DNS-01 challenge with a DuckDNS domain.Table of ContentsAboutInstallationPrerequirementsWith pip (recommend)From sourceSnapUsageCredentials file or cli parametersLocal installation usageDocker usagePlugin argumentsFAQThird party noticesLicenseAboutcertbot_dn_duckdnsis a plugin forcertbotto create the DNS-01 challenge for
a DuckDNS domain. The plugin takes care of setting and deleting the TXT entry via the DuckDNS API.InstallationPrerequirementsIf you want to use the docker image, then you don't need any requirements other than a working docker installation and
can proceed directly to theusageIf you prefer the local installation, then you need at least version 3.7 of Python installed. If you want to install
this plugin with pip, then you also need pip3 installed.If you already havecertbotinstalled, make sure you have at least version1.18.0installed. When you installedcertbotas snap then you have to use thesnap installationof the plugin.You can check what version ofcertbotis installed with this command:certbot --versionIf you don't have certbot installed yet, then the PyPI version of certbot will be installed automatically during the
installation.Note: If you want to run certbot with root privileges, then you need to install the plugin with root privileges too.
Otherwise, certbot cannot find the plugin.With pip (recommend)Use the following command to installcertbot_dns_duckdnswith pip:pip install certbot_dns_duckdnsYou can also very easily update to a newer version:pip install certbot_dns_duckdns -UFrom sourcegit clone https://github.com/infinityofspace/certbot_dns_duckdns
cd certbot_dns_duckdns
pip install .SnapIf you use thecertbotas snap package then you have to installcertbot_dns_duckdnsas a snap too:snap install certbot-dns-duckdnsNow connect thecertbotsnap installation with the plugin snap installation:sudo snap connect certbot:plugin certbot-dns-duckdnsThe following command should now listdns-duckdnsas an installed plugin:certbot pluginsUsageNote: You cannot create certificates for multiple DuckDNS domains with one certbot call. This is because DuckDNS only
allows one TXT record. If certificates for several domains should be created at the same time, then the same number of
distinct DNS TXT records must be created. To solve the problem, you simply have to make a separate certbot call for each
domain.Note that the certificate generation through Letsencrypt has rate limits. For testing, use the additional
argument--stagingto solve this problem.Credentials file or cli parametersYou can either use cli parameters to pass authentication information to certbot:...
--dns-duckdns-token <your-duckdns-token>Or to prevent your credentials from showing up in your bash history, you can also create a
credentials-fileduckdns.ini(the name does not matter) with the following content:dns_duckdns_token=<your-duckdns-token>And then instead of using the--dns-duckdns-keyparameter above you can use...
--dns-duckdns-credentials </path/to/your/duckdns.ini>You can also mix these usages, though the cli parameters always take precedence over the ini file.Local installation usageTo check if the plugin is installed correctly and detected properly by certbot, you can use the following command:certbot pluginsBelow are some examples of how to use the plugin:Generate a certificate for a DNS-01 challenge of the domain "example.duckdns.org":certbot certonly \
  --non-interactive \
  --agree-tos \
  --email <your-email> \
  --preferred-challenges dns \
  --authenticator dns-duckdns \
  --dns-duckdns-token <your-duckdns-token> \
  --dns-duckdns-propagation-seconds 60 \
  -d "example.duckdns.org"Generate a certificate for a DNS-01 challenge of the subdomain "cloud.example.duckdns.org":certbot certonly \
  --non-interactive \
  --agree-tos \
  --email <your-email> \
  --preferred-challenges dns \
  --authenticator dns-duckdns \
  --dns-duckdns-token <your-duckdns-token> \
  --dns-duckdns-propagation-seconds 60 \
  -d "cloud.example.duckdns.org"Generate a wildcard certificate for a DNS-01 challenge of all subdomains "*.example.duckdns.org":certbot certonly \
  --non-interactive \
  --agree-tos \
  --email <your-email> \
  --preferred-challenges dns \
  --authenticator dns-duckdns \
  --dns-duckdns-token <your-duckdns-token> \
  --dns-duckdns-propagation-seconds 60 \
  -d "*.example.duckdns.org"Generate a certificate for a DNS-01 challenge of the domain "example.duckdns.org" using a credentials file:certbot certonly \
  --non-interactive \
  --agree-tos \
  --email <your-email> \
  --preferred-challenges dns \
  --authenticator dns-duckdns \
  --dns-duckdns-credentials </path/to/your/duckdns.ini> \
  --dns-duckdns-propagation-seconds 60 \
  -d "example.duckdns.org"Generate a certificate for a DNS-01 challenge of the domain "example.duckdns.org" without an account (i.e. without an
email address):certbot certonly \
  --non-interactive \
  --agree-tos \
  --register-unsafely-without-email \
  --preferred-challenges dns \
  --authenticator dns-duckdns \
  --dns-duckdns-token <your-duckdns-token> \
  --dns-duckdns-propagation-seconds 60 \
  -d "example.duckdns.org"Generate a staging certificate (i.e. temporary testing certificate) for a DNS-01 challenge of the domain "
example.duckdns.org":certbot certonly \
  --non-interactive \
  --agree-tos \
  --email <your-email> \
  --preferred-challenges dns \
  --authenticator dns-duckdns \
  --dns-duckdns-token <your-duckdns-token> \
  --dns-duckdns-propagation-seconds 60 \
  -d "example.duckdns.org" \
  --stagingDNS-01 Challenges allow using CNAME records or NS records to delegate the challenge response to other DNS zones.
For example, this allows you to resolve the DNS challenge for another provider's domain using a duckdns domain.
For example, we haveabc.duckdns.orgas duckdns domain andexample.comas our other domain.
We might have an existing DNS configuration which look like this:one.example.com. 600 IN CNAME two.example.com.
two.example.com. 600 IN CNAME abc.duckdns.org.It chainsone.example.comtotwo.example.comand finally toabc.duckdns.org.Now we want to issue a DNS-01 challenge for the subdomain "test.example.com".
So we create a CNAME record for "_acme-challenge.test.example.com" pointing to "one.example.com".
The DNS records now look like this:_acme-challenge.test.example.com. 600 IN CNAME one.example.com.
one.example.com. 600 IN CNAME two.example.com.
two.example.com. 600 IN CNAME abc.duckdns.org.Now we use certbot to generate a certificate for the domaintest.example.comwith the DNS challenge:certbot certonly \
  --non-interactive \
  --agree-tos \
  --email <your-email> \
  --preferred-challenges dns \
  --authenticator dns-duckdns \
  --dns-duckdns-token <your-duckdns-token> \
  --dns-duckdns-propagation-seconds 60 \
  -d "test.example.com" \What happens in the background can be seen very well in the DNS records:_acme-challenge.test.example.com. 600 IN CNAME one.example.com.
one.example.com. 600 IN CNAME two.example.com.
two.example.com. 600 IN CNAME abc.duckdns.org.
abc.duckdns.org. 60 TXT "asduh9asudhßa97sdhap9sudaisudoi"When validating the DNS challenge value, all CNAME records are now traversed.
It starts with_acme-challenge.test.example.comand goes toone.example.com, then totwo.example.comand finally
toabc.duckdns.org. Here is the validation token stored as TXT record.The example could also be shortened by directly creating a CNAME entry from_acme-challenge.test.example.comtoabc.duckdns.org. So we skip all other CNAME records in between. To make it clear that any CNAME records are traversed
during validation, the intermediate parts are added in the previous example.Try to update all currently generated certificates:certbot renewYou can find al list of all available certbot cli options in
theofficial documentationofcertbot.Docker usageYou can simply start a new container and use the same certbot commands to obtain a new certificate:docker run -v "/etc/letsencrypt:/etc/letsencrypt" -v "/var/log/letsencrypt:/var/log/letsencrypt" infinityofspace/certbot_dns_duckdns:latest \
   certonly \
     --non-interactive \
     --agree-tos \
     --email <your-email> \
     --preferred-challenges dns \
     --authenticator dns-duckdns \
     --dns-duckdns-token <your-duckdns-token> \
     --dns-duckdns-propagation-seconds 60 \
     -d "example.duckdns.org"Or you can use a credentials file:docker run -v "/etc/letsencrypt:/etc/letsencrypt" -v "/var/log/letsencrypt:/var/log/letsencrypt" -v "/absolute/path/to/your/duckdns.ini:/conf/duckdns.ini" infinityofspace/certbot_dns_duckdns:latest \
   certonly \
     --non-interactive \
     --agree-tos \
     --email <your-email> \
     --preferred-challenges dns \
     --authenticator dns-duckdns \
     --dns-duckdns-credentials /conf/duckdns.ini \
     --dns-duckdns-propagation-seconds 60 \
     -d "example.duckdns.org"If you want to use the docker image to renew your certificates automatically, you can do this with the host cron, for
example. To use this example you must have crontab and cron installed beforehand. Note that depending on the
installation you may need to use the crontab of a root user to access the docker daemon or file directories. For
example, use the following crontab expression:0 3 */8 * * docker run --rm -v "/etc/letsencrypt:/etc/letsencrypt" -v "/var/log/letsencrypt:/var/log/letsencrypt" infinityofspace/certbot_dns_duckdns:latest  renewThis will start a temporary docker container every 8 days at 3am and tries to renew expiring certificates.An example for the usage with docker-compose can be foundhere.Plugin argumentsObtain certificates using a DNS TXT record for DuckDNS domains

  --dns-duckdns-propagation-seconds DNS_DUCKDNS_PROPAGATION_SECONDS
                        The number of seconds to wait for DNS to propagate before asking the ACME server to verify the DNS record. (default: 30)
  --dns-duckdns-credentials DNS_DUCKDNS_CREDENTIALS
                        DuckDNS credentials INI file. (default: None)
  --dns-duckdns-token DNS_DUCKDNS_TOKEN
                        DuckDNS token (overwrites credentials file) (default: None)
  --dns-duckdns-no-txt-restore
                        Do not restore the original TXT record (default: False)FAQYou can the FAQ in thewiki.Third party noticesAll modules used by this project are listed below:NameLicensecertbotApache 2.0requestsApache 2.0setuptoolsMITdnspythonISCFurthermore, this readme file contains embeddings ofShields.io.LicenseMIT- Copyright (c) 2021-2022 Marvin Heptner