Skip to content

DNS providers

A DNS provider lets SSLense publish validation records in one zone. In the app, use Settings › DNS providers: open Add a DNS provider, choose the Service, fill in the fields it shows, and choose Add provider. Test adds and removes a TXT record. Credentials are typed without echo, never passed as command-line arguments, and encrypted on the server with Windows DPAPI.

Settings, DNS providers: a Cloudflare zone, a script, and acme-dns with the CNAME to create

From the command line:

Terminal window
SSLense.Cli dns list
SSLense.Cli dns test --name "Main" # adds and removes a TXT record at _sslense-test.<zone>
SSLense.Cli dns update-token --name "Main" # for a token that expired or was replaced
SSLense.Cli dns remove --name "Main" # refused while a certificate renews through it

In Cloudflare, go to My Profile › API Tokens › Create Token and use the Edit zone DNS template, for one zone. The zone ID is on the domain's Overview page.

Terminal window
SSLense.Cli dns add --provider cloudflare --name "Main" --zone example.com --zone-id <zone ID>

An IAM user with an access key, allowed route53:ChangeResourceRecordSets, route53:ListResourceRecordSets and route53:GetHostedZone on the hosted zone. The zone ID is the hosted zone's ID.

Terminal window
SSLense.Cli dns add --provider route53 --name "AWS" --zone example.com --zone-id Z0123456789ABCDEFGHIJ

SSLense asks for the access key ID, then the secret access key.

An app registration with a client secret, given the DNS Zone Contributor role on the zone.

Terminal window
SSLense.Cli dns add --provider azure --name "Azure" --zone example.com --zone-id <subscription ID>/<resource group>

SSLense asks for the tenant ID, the client ID and the client secret.

A service account with the DNS Administrator role, and its JSON key file. The zone ID is the managed zone's name.

Terminal window
SSLense.Cli dns add --provider google --name "GCP" --zone example.com --zone-id example-com --key-file .\dns-key.json

An API token with write access to DNS.

Terminal window
SSLense.Cli dns add --provider digitalocean --name "DO" --zone example.com
SSLense.Cli dns add --provider hetzner --name "Hetzner" --zone example.com

acme-dns is a small DNS server made only for validation records. You create one CNAME, once, at your DNS host, and SSLense updates only that name, with a credential that can change nothing else. Your DNS host needs no API.

Terminal window
SSLense.Cli dns add --provider acme-dns --name "Shop acme-dns" --domain example.com --server https://auth.acme-dns.io
# SSLense shows the record to create at your DNS host, for example:
# _acme-challenge.example.com CNAME 8e57…d1.auth.acme-dns.io
SSLense.Cli dns test --name "Shop acme-dns"
  • One account per domain. It covers the domain and its wildcard. Add another account, with its own CNAME, for each other name.
  • The CNAME is checked before each order and daily, and the digest says so if it is gone.
  • --allow-from 203.0.113.10/32 limits updates to this server's address; --import takes an account another tool registered.
  • The public server is run by volunteers, with no promise of uptime, and whoever runs an acme-dns server can answer validations for the names that point to it. For an important domain, run your own.

Your own script: any DNS service with an API

Section titled “Your own script: any DNS service with an API”

Write a PowerShell script that adds and removes one TXT record through your DNS service's API, and SSLense does the rest. Start from Template.ps1 in C:\Program Files\SSLense\dns-scripts\; Cloudflare.ps1 there is a complete example.

Terminal window
SSLense.Cli dns add --provider script --name "Registrar" --zone example.com --script C:\Scripts\registrar.ps1 --secret
SSLense.Cli dns test --name "Registrar"
SSLense.Cli dns update-script --name "Registrar" --script C:\Scripts\registrar.ps1 # after you change the script

SSLense runs it as powershell.exe -File <script> -Action Check|Add|Remove -Zone <zone> -RecordName _acme-challenge.<name> -Value <value>, and expects exit code 0. --secret asks for one secret, such as an API key, given to the script in the SSLENSE_DNS_SECRET environment variable; for two values, use key:secret. Each call may run for 2 minutes, or --timeout seconds.

  • Read a script before adding it. The renewal service runs it as SYSTEM.
  • SSLense runs its own copy, in C:\ProgramData\SSLense\dns-scripts, and checks its SHA-256 before every run. After editing the original, run dns update-script.
  • Test as you, renew as SYSTEM. Install any module the script needs for all users (Install-Module -Scope AllUsers). In the 30 days before each renewal, the service runs the script's Check daily, so a problem shows in the digest before the renewal fails.
  • A Group Policy execution policy still applies: on a server that requires signed scripts, sign it.