How can DNS validation for 47-day certificates run without manual record edits?
At 47-day lifetimes, a certificate renews roughly every six to seven weeks, and each renewal can require a fresh DNS-01 challenge. A process that waits for someone to edit a _acme-challenge TXT record by hand cannot keep up with that cadence. DNS-01 can be automated in three common ways: Certbot's DNS plugins (for example, --dns-cloudflare or --dns-route53, installed separately), lego's provider list of about 252 DNS entries, or Certbot's --manual-auth-hook and --manual-cleanup-hook, which run a script before and after validation using variables such as CERTBOT_VALIDATION. Shorter lifetimes mean this DNS path runs on every renewal, not once a year, so the record update has to succeed reliably on every run.
The DNS and platform teams are the ones who must act. The DNS team decides how the _acme-challenge names are created and what API credentials the ACME client may use, and should scope those credentials to the minimum zone and record permissions needed. The platform team owns the renewal job, the hook scripts and the error handling around them. For the dates on which each lifetime step takes effect, see the schedule table on this page.
Several configuration points decide whether the automation holds. Stale TXT records should be removed after each validation, because the Let's Encrypt challenge types guidance notes that oversized responses are rejected. Multiple TXT records can coexist at one name, so cleanup must target only the record the job created. Let's Encrypt also limits authorization failures to 5 per identifier per account per hour, so a broken credential or misnamed record will stop renewals quickly, and alerting should catch failures on the first attempt. DNS-01 cannot validate IP addresses, which matters if any certificate covers an IP identifier.
If the DNS provider's API is not supported by a plugin, delegation is the other route. Let's Encrypt's challenge types page says a CNAME or NS record can redirect the challenge to a zone the ACME client controls, which keeps the production zone free of automation credentials. Confirm each delegation, plugin version and provider permission against the current documentation for the client you run, since the specifics vary by product.
What each lifetime step changes for DNS-based renewals
This table sets each step of the Baseline Requirements schedule against the domain validation reuse period that applies at that step, and what that reuse means for DNS-01 renewals. Read each row as a date range: the reuse period is the time a completed DNS check can be relied on before the CA must check again. The main takeaway is that longer reuse cuts how often DNS records must be written, but DNS access must still work every time a renewal needs a fresh check.
| Step | Maximum certificate lifetime and domain reuse | What it means for DNS validation |
|---|---|---|
| Before 2026-03-15 | Certificates may last up to 398 days. Domain validation reuse is 398 days by issuance date. | A DNS check can be reused for most of a year, so renewals create DNS writes infrequently. Confirm the reuse period your CA applies. |
| From 2026-03-15 | Certificates may last up to 200 days. Domain validation reuse is 200 days by issuance date. | Renewals occur roughly every 200 days per name, so a few DNS writes a year per domain. A reused check still needs working DNS access when it expires. |
| From 2027-03-15 | Certificates may last up to 100 days. Domain validation reuse is 100 days by issuance date. | Renewals occur roughly every 100 days per name, about four times a year. Automation of the TXT record becomes more valuable at this step. |
| From 2029-03-15 | Certificates may last up to 47 days. Domain validation reuse is 10 days by issuance date. | Renewals may need a fresh DNS check about every 10 days, so the DNS write path must run on an automated, recurring basis. Working DNS access is required throughout. |
| Let's Encrypt opt-in tlsserver profile | 45-day certificates from 13 May 2026, according to Let's Encrypt's 2 December 2025 post. | Renewals are roughly every 45 days for teams that opt in. Confirm the profile name and enrollment steps in Let's Encrypt's documentation. |
| Let's Encrypt classic profile, 10 February 2027 | 64-day certificates with 10-day authorization reuse, per Let's Encrypt's 2 December 2025 post. | The DNS-01 record is needed again within about 10 days, which is shorter than the 100-day step in the Baseline Requirements schedule. |
| Let's Encrypt classic profile, 16 February 2028 | 45-day certificates with 7-hour authorization reuse, per Let's Encrypt's 2 December 2025 post. | A DNS-01 check may be needed every few hours. Plan DNS access so a challenge can complete on demand, not on a schedule. |
How the DNS-01 challenge creates and removes the TXT record
When a CA validates a domain with the DNS-01 challenge, the ACME client must put a specific value in the DNS. RFC 8555 section 8.4 defines the name and the value. The client prepends _acme-challenge to the domain being validated, so a certificate for www.example.com is checked at _acme-challenge.www.example.com. It then publishes a TXT record at that name holding the base64url encoding of the SHA-256 digest of the key authorization. Your automation must create this record, wait until the CA can read it, and remove it after validation finishes. Platform and DNS teams should confirm that the DNS provider's API can create and delete TXT records at that exact label, and that the credentials used for those calls are scoped to the zone they need and no more.
The CA queries the record during validation, and the record has to exist when that query happens. Removing it too early causes the authorization to fail, while leaving it in place after validation is untidy and creates a second risk. Multiple TXT records can exist at the same name, which is useful when a client validates several identifiers or runs parallel orders. Stale records left over from earlier attempts are the problem. Let's Encrypt's challenge types documentation says oversized responses get rejected because of stale records, so a cleanup hook that deletes only the newest value is not enough. Your cleanup step should remove the specific values the client created for that run, and a periodic sweep of _acme-challenge labels can catch what a failed run leaves behind.
DNS-01 cannot validate IP addresses, so it covers only domain names. Any certificate that includes an IP identifier needs a different validation method, and the HTTP-01 and TLS-ALPN-01 methods are covered on a sibling page. Before you commit to DNS-01 across the estate, inventory which certificates name only domains and which name IP addresses. Your certificate automation should also be checked against the sources you rely on: confirm in your client's documentation which record handling, hook variables and cleanup behavior apply to the version you run, because the behavior of cleanup hooks and provider plugins differs between ACME clients.
Which DNS automation methods are available and what each needs
Certbot ships DNS plugins that write the validation TXT record through a provider's API, so renewals run without anyone editing zone records. The documentation names plugins for Cloudflare, DigitalOcean, DNSimple, DNS Made Easy, Gehirn, Google, Linode, LuaDNS, NS1, OVH, RFC 2136, Route53 and Sakura Cloud. Each one has its own flag, such as --dns-cloudflare, and each is installed as a separate package alongside Certbot itself.
- Separate installation: Each plugin must be installed before its flag works, so confirm the package for your provider is present on every renewal host.
- Provider credentials: Each plugin reads its own credentials file or settings, so store the API token with the minimum record-editing scope the provider allows.
- Named providers only: The plugins listed in the documentation are the ones this method covers; a provider not on that list needs another tab's method.
- Renewal path: The same flag must be present in the renewal configuration, so check that scheduled renewals run with it.
Before relying on a plugin, confirm its exact flag, installation package and credential format in the Certbot documentation for the version you run.
Certbot's manual mode can call your own scripts through --manual-auth-hook and --manual-cleanup-hook. The auth hook runs before validation and the cleanup hook runs after, and Certbot passes values such as CERTBOT_VALIDATION and CERTBOT_TOKEN into the script's environment. Your script can then create the TXT record through whatever DNS API your team uses, which lets you automate a provider Certbot does not ship a plugin for.
- Script responsibility: The hook script owns record creation and removal, so errors in it cause failed validations rather than being handled by Certbot.
- Variables passed in:
CERTBOT_VALIDATIONcarries the value for the TXT record andCERTBOT_TOKENidentifies the challenge, so read them from the environment rather than hard-coding values. - Cleanup matters: The cleanup hook should remove the record, because stale TXT records can cause oversized DNS responses that the CA rejects.
- Propagation timing: The script must wait until the record is visible before Certbot continues, so build a check into the hook.
Test the hooks against a staging zone first, and confirm the variable names for your Certbot version in its documentation.
lego is a standalone ACME client whose documentation lists about 252 DNS provider entries, including manual, exec and httpreq. The exec and httpreq options let you connect lego to a provider it does not support natively, by running a command or calling an HTTP endpoint that writes the record. The documentation's example is lego run --dns cloudflare --domains www.example.com, with provider credentials passed in environment variables.
- Environment credentials: Each provider reads its settings from environment variables named in its documentation, so keep them out of shell history and configuration files in version control.
- Exec for custom DNS: The
execoption calls a program you supply, which suits in-house DNS services. - Httpreq for APIs: The
httpreqoption sends record changes to an HTTP endpoint, which needs that endpoint to be secured and reachable from the renewal host. - Count is not coverage: The roughly 252 entries are a count from the documentation, so confirm your exact provider appears in the current list.
Check the provider's entry in the lego documentation for the variables it expects before deploying.
Delegated validation moves the validation records into a separate DNS zone that your automation can control, so the main zone never receives API access from renewal jobs. Let's Encrypt's challenge types page says you can use CNAME records or NS records to delegate answering the DNS-01 challenge to other DNS zones. A CNAME points the _acme-challenge name at a record in the delegated zone, while an NS delegation hands the whole label to a zone you operate.
- CNAME delegation: Create a CNAME at
_acme-challengefor each domain pointing to a record in the delegated zone, which limits the automation's access to that zone. - NS delegation: Delegate a subdomain to a zone that the automation can write, which covers the challenge names beneath it.
- Multiple TXT records: Several TXT records may exist at one name, but stale ones should be removed because oversized responses get rejected.
- No IP validation: DNS-01 cannot validate IP addresses, so this method applies only to domain names.
Confirm the delegation records with your DNS provider and check the Let's Encrypt challenge types page for the current rules.
How to set up DNS validation step by step
This sequence gives you a DNS-01 setup that a script can complete without manual record edits, so each renewal can prove domain control through the zone itself. Each step ends with a check you can run before moving on to the next one.
Confirm DNS API access and credentials
The DNS or platform team confirms which provider hosts the zone that will answer the challenge, then creates an API credential scoped to editing TXT records in that zone. Store the credential where the ACME client can read it, not in a shared file or a ticket. Confirm the credential works by listing records in the zone with a read-only call before you rely on it for writes. The step is done when a test read returns the expected records and a write-scoped test record can be created and deleted. The exact credential fields differ by provider, so take them from that provider's documentation rather than from this page.
Delegate the _acme-challenge name
If the zone that holds your domain is managed separately from the zone your ACME client can reach, create a CNAME record at _acme-challenge.yourdomain pointing to a name in the zone you control, or an NS record that delegates the label to that zone. Let's Encrypt documents both CNAME and NS delegation for DNS-01, so either works for that CA. The owner of the main zone makes this change once, and the platform team does not need to repeat it at each renewal. Check the result with a DNS lookup of _acme-challenge.yourdomain and confirm it resolves to the zone you expect. If the zone is not separate, skip this step.
Install the Certbot plugin or set lego credentials
For Certbot, install the DNS plugin that matches your provider, since Certbot lists its DNS plugins as separate installs, each with a flag such as --dns-cloudflare. For lego, the provider is chosen with the --dns flag and credentials are passed through environment variables, and lego's documentation lists the field names for each provider. Set the variables in the environment of the account or service that runs renewals, and keep them out of command history and shared configuration. The step is done when the client reports the plugin or provider as available and does not fail on a credential error during a dry run. Confirm each credential field name against the provider page for your client version.
Run a test issuance against staging
Run one issuance against the CA's staging environment before pointing the job at production. For lego, the example form is lego run --dns cloudflare --domains www.example.com, where you swap in your provider and your own name, and you add the staging server option your lego version documents. The test checks that the TXT record is created, that the CA can see it, and that the temporary record is removed afterward. Watch for stale TXT records from earlier runs, because the Let's Encrypt challenge types page says oversized responses get rejected, so remove leftovers before retrying. The step is done when staging returns a certificate and the zone holds no leftover _acme-challenge records.
Configure auth and cleanup hooks
If you use a manual or custom challenge flow instead of a built-in plugin, configure the authentication hook and the cleanup hook. Certbot's --manual-auth-hook runs before validation and --manual-cleanup-hook runs after it, and both receive variables such as CERTBOT_VALIDATION and CERTBOT_TOKEN that your script uses to write and remove the record. The cleanup hook matters because a failed run can leave records behind, and Let's Encrypt's rate limits allow up to 5 authorization failures per identifier per account every hour. Test each hook by hand against a test name in the zone and confirm it removes its own record. If you use a built-in DNS plugin, you do not need these hooks, so skip this step.
Schedule renewal with the lifetime in mind
Set your renewal job to run on a schedule, and let the ACME client decide when a certificate is due. Certbot's documentation says that from version 4.0.0 a certificate is due when less than one third of its lifetime remains, or one half for lifetimes of 10 days or less, so the trigger moves with the lifetime rather than a fixed 30 days. Let's Encrypt's integration guide recommends checking ACME Renewal Information at least twice a day, which RFC 9773 defines as the suggestedWindow returned by the server. Run one renewal in dry-run mode and confirm the job reports the certificate as not yet due and the next check time. The step is done when the schedule runs without manual input and logs each renewal decision.
What must be in place before DNS validation runs unattended
DNS-01 validation can renew without anyone editing records by hand, but only when the client, credentials, DNS zones and key storage are ready beforehand. The six items below are the ones to confirm and test before a renewal job runs unattended against production zones.
Certbot 4.0.0 or later
Certbot 4.0.0 changed the renewal rule. A certificate is due for renewal when less than one third of its lifetime remains, or one half when its lifetime is 10 days or less. Earlier versions used a fixed 30 days, which does not fit 47-day certificates. Check the installed version with certbot --version on every host that renews, because a mixed fleet will renew on different schedules. Confirm the renewal timing against Certbot's documentation for the release you run.
Least-privilege DNS API credentials
The DNS plugin or lego needs a credential that can create and delete TXT records at _acme-challenge names and nothing else. Scope it to the specific zones being validated, not the whole account. Confirm with your DNS provider which permission grants record writes, and avoid credentials that can change nameservers, delete zones or manage billing. Rotate the credential on a schedule and record who owns it, since a renewal job will fail silently if the key is revoked.
Zone delegation for _acme-challenge
Where validation records should not live in the main zone, delegate _acme-challenge to a separate DNS zone using a CNAME or NS record. Let's Encrypt documents both forms for pointing the DNS-01 answer at another zone. This limits the credential's reach to the delegated zone. Before rollout, query the delegated name from outside your network to confirm the chain resolves, because a broken delegation will fail every renewal that depends on it.
Plugin or lego binary installed
Install the DNS plugin that matches your provider. Certbot DNS plugins are separate packages, each enabled by a flag such as --dns-cloudflare, and they are not bundled with Certbot itself. Alternatively, lego ships with a large set of DNS provider integrations, including manual, exec and httpreq for custom setups. Confirm the plugin name for your provider in the tool's own list, then run a single issuance in a test host to catch missing packages before the job is scheduled.
Secure store for credentials and account key
The DNS API credential and the ACME account key both grant power over issuance, so store them outside plain configuration files and out of shared repositories. Limit read access to the renewal service account, log access, and restrict backups of the store. Let's Encrypt's 2026 guidance on persistent DNS records treats the account key as the asset to protect, since it controls the validation record. Document where each secret lives and how it is replaced.
Test environment proving the path
Before rollout, run the full path against a non-production zone and a staging ACME endpoint: create the TXT record, wait for propagation, validate, and clean up the record. Confirm that stale TXT records are removed, since leftover records can produce oversized responses that get rejected. Watch for failed authorizations, because Let's Encrypt limits authorization failures to 5 per identifier per account each hour, and repeated failures from a broken job can block renewals. Only move to production once several consecutive test renewals pass.
- Authorization failure limit
- 5 per hour
How to confirm DNS-based renewals keep happening
Automating DNS-01 validation only protects you if renewals keep completing, so the first check is an alert on certificate expiry that fires well before the renewal window opens. Under the schedule in the Baseline Requirements, certificates issued from 2026-03-15 are valid for 200 days and move to 100 days from 2027-03-15, so a renewal failure that goes unnoticed for a single cycle can leave less room to recover than it did before. Set the alert threshold from the renewal point your ACME client uses (for Certbot 4.0.0 and later, that is when less than one third of the lifetime remains, or one half for lifetimes of 10 days or less), and confirm the alert reaches a person who can act on it, not only a shared mailbox nobody reads. Check the threshold against the lifetime in force on each date, since it moves with the schedule.
Next, read the client's log on every renewal attempt, not only the failures. A successful run should show the DNS record being created, the CA finding it, and the record being cleaned up. Repeated failures matter because Let's Encrypt allows up to 5 authorization failures per identifier per account every hour, so a broken DNS credential can lock out a domain for a period while the failures keep piling up. Also confirm the _acme-challenge TXT record is actually removed after validation. Let's Encrypt notes that stale TXT records can cause oversized responses to be rejected, so leftover records from earlier runs are a cause of later failures, not just clutter. Check your DNS provider's record list directly rather than trusting the client's output alone. Your hook scripts (for example the --manual-cleanup-hook path in Certbot) should be tested in the same way.
Finally, check ACME Renewal Information at least twice a day, as Let's Encrypt's integration guide recommends, and make sure your client does so. RFC 9773 defines the renewalInfo resource that returns a suggestedWindow, and a renewal can name the certificate it replaces through the replaces field, so the CA can see a renewal coming. Keep a dated record of each renewal (certificate serial, validation method, the DNS zone changed, the outcome and the log excerpt) and keep it somewhere an auditor or customer can ask for it. Keeping that record does not on its own satisfy any specific requirement; confirm with your assessor which evidence they expect.
How a DNS-01 renewal flows from client to DNS provider and back
The renewal starts in the ACME client or controller, which asks the certificate authority for a DNS-01 challenge and receives a token. The client then calls the DNS provider's API, or updates a delegated zone reached through a CNAME or NS record, to publish a TXT record at _acme-challenge holding the key authorization digest. After the authority validates the record, the client removes it, and the new certificate is deployed and the service reloaded. Check that stale TXT records are cleaned up, since oversized responses are rejected and each account is limited to 5 authorization failures per identifier per hour.
Shows the DNS-01 hand-offs from client to DNS provider, validation, cleanup and deployment.
Questions teams ask about automating DNS validation
Can DNS-01 validation be fully automated?
Yes, in principle. DNS-01 works by publishing a TXT record at _acme-challenge under the domain being validated, and RFC 8555 defines that record as the base64url encoding of the SHA-256 digest of the key authorization. Because the record is created and removed through software, a client can complete the whole check without a person editing records, provided it has API access to the DNS provider. Automation depends on three things: a client that supports your DNS provider, credentials scoped to the right zone, and a cleanup step that removes the record after validation. Confirm each of these in your own environment before relying on it.
Does DNS-01 work for wildcard certificates?
The sources listed on this page do not state wildcard-specific behavior for DNS-01, so confirm it against the current Let's Encrypt challenge types documentation and the Baseline Requirements before planning around it. What the sources do establish is the mechanics: the TXT record is placed at the _acme-challenge name for the domain being validated, and multiple TXT records can exist at the same name. Plan for that case when your renewal script runs more than once against the same zone, and confirm wildcard handling with your ACME client's documentation.
Can I use a CNAME to delegate DNS-01 validation?
Yes. Let's Encrypt's challenge types page says you can use CNAME records or NS records to delegate answering the DNS-01 challenge to another DNS zone. This lets a team keep the validation record in a zone that is easier to automate, such as one hosted with a provider whose API the team already uses, while the production zone holds only a CNAME. Set the delegation up deliberately and record which zone holds each validation record, so that renewals and audits can trace where the check is answered.
Which Certbot DNS plugins are available?
Certbot's documentation lists DNS plugins for Cloudflare, DigitalOcean, DNSimple, DNS Made Easy, Gehirn, Google, Linode, LuaDNS, NS1, OVH, RFC 2136, Route53 and Sakura Cloud. Each has a flag such as --dns-cloudflare, and the plugins are installed separately from Certbot itself. If your provider is not on the list, Certbot's manual hooks, --manual-auth-hook and --manual-cleanup-hook, can call your own script, which receives variables such as CERTBOT_VALIDATION and CERTBOT_TOKEN. Check the current Certbot documentation for the exact plugin names and install steps for your version.
What happens when a DNS-01 renewal fails?
A failed renewal leaves the existing certificate in service until it expires, so the main risk is a silent failure that goes unnoticed. Let's Encrypt's rate limits allow up to 5 authorization failures per identifier per account every hour, so repeated retries from a broken script can block further attempts for that name. Stale TXT records also cause trouble: the challenge page says oversized responses get rejected, so remove old records during cleanup. Monitor renewal outcomes, alert on failure, and fix the root cause before the retry window closes.
Does DNS-01 work for IP addresses?
No. Let's Encrypt's challenge types page says DNS-01 cannot validate IP addresses. Because the method relies on a TXT record under a domain name, any certificate that covers an IP address needs a different domain control method. Check the Baseline Requirements' list of active domain validation methods, and confirm with your certificate authority which methods it accepts for IP address identifiers before you design the renewal flow.
When should we get outside help with DNS validation automation?
Consider outside help when the work spans several DNS providers, when zones are delegated across teams, or when renewal failures are not being caught. DeployOpen plans, implements and documents self-hosted open-source platforms inside a client's own infrastructure, and can support the platform side of certificate automation as part of a fixed-scope engagement with written deliverables and timelines. DeployOpen does not issue certificates or audit reports. Pricing follows from a written scope, so ask for a quote once your provider list and zone layout are known.
How DeployOpen helps teams automate DNS validation
DeployOpen scopes, builds and hands over DNS validation automation inside your own infrastructure, so renewals that happen every 47 days do not depend on manual record edits. Each engagement starts with a written scope that names the zones, DNS providers and certificate clients involved.
How we scope
- We inventory every domain and zone that needs DNS-01 validation and record which DNS provider hosts each one.
- We check whether delegated zones or CNAME records can point challenges to a separate zone you control.
- Engagements are fixed-scope, with deliverables and timelines agreed in writing before any build work begins.
How we build
- We configure the ACME client and its DNS plugin or provider API so TXT records at _acme-challenge are created and removed automatically.
- We set cleanup so stale TXT records are removed, since oversized responses can cause validation to be rejected.
- We test renewal end to end, including failure handling, so authorization failures stay within the published rate limits.
How we hand over
- You receive documentation covering credentials, record naming, renewal triggers and the monitoring you need to run.
- We document how renewal timing follows the renewal guidance from your ACME client, checked at least twice a day.
- Your DNS and platform teams are walked through the runbook so they can operate and troubleshoot the setup themselves.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers for DNS validation automation.
- We can review changes to DNS providers, API credentials or certificate clients before they affect renewals.
- Confirm the current DNS-01 and persistent-record rules with your certificate authority and its published documentation before you rely on them.

