LinuxCommandLibrary

acme.sh-dns

Issue certificate using Cloudflare DNS

TLDR

Issue certificate using Cloudflare DNS

$ export CF_Token="[token]" && acme.sh --issue -d [example.com] --dns dns_cf
copy
Issue using AWS Route53
$ export AWS_ACCESS_KEY_ID="[key]" && export AWS_SECRET_ACCESS_KEY="[secret]" && acme.sh --issue -d [example.com] --dns dns_aws
copy
Issue using DigitalOcean DNS
$ export DO_API_KEY="[token]" && acme.sh --issue -d [example.com] --dns dns_dgon
copy
Issue wildcard certificate with DNS
$ acme.sh --issue -d [example.com] -d [*.example.com] --dns dns_cf
copy

SYNOPSIS

acme.sh --issue -d domain --dns dnsprovider [options_]

DESCRIPTION

acme.sh DNS mode enables automated certificate issuance using DNS-01 validation. This method proves domain ownership by creating a specific TXT record in the domain's DNS zone. It's required for wildcard certificates and useful when HTTP validation isn't possible.
The tool supports over 100 DNS providers through API integration. Credentials are typically provided via environment variables, and acme.sh handles creating and removing the validation records automatically.

PARAMETERS

--dns provider

DNS provider plugin name (dnscf, dnsaws, dnsgd, dnsali, etc.)
--dnssleep seconds
Seconds to wait for DNS propagation (default: automatic)
--dns-alias domain
Use alias domain for DNS validation (CNAME delegation)
-d domain
Domain name (repeat for wildcards: -d example.com -d *.example.com)

COMMON DNS PROVIDERS

dns_cf

Cloudflare (CFToken or CFKey + CF_Email)
dns_aws
AWS Route53 (AWSACCESSKEYID + AWSSECRETACCESSKEY)
dns_gd
GoDaddy (GDKey + GDSecret)
dns_dgon
DigitalOcean (DOAPIKEY)
dns_ali
Aliyun/Alibaba Cloud (AliKey + AliSecret)
dns_gcloud
Google Cloud DNS (CLOUDSDKACTIVECONFIG_NAME)
dns_linode
Linode (LINODEV4API_KEY)
dns_ovh
OVH (OVHAK + OVHAS + OVH_CK)

CAVEATS

API credentials are stored in account.conf for automatic renewal. DNS propagation can take time; increase --dnssleep if validation fails. Some providers have rate limits on API calls. API token permissions should be limited to DNS management only.

HISTORY

DNS validation support was added to acme.sh in 2016 following the ACME protocol specification. The number of supported DNS providers has grown substantially, with community contributions adding new providers regularly.

SEE ALSO

acme.sh(1), certbot(1), dig(1), nslookup(1)

Copied to clipboard