Custom Hostname Validation, DCV Methods and Production Readiness
How Cloudflare for SaaS separates hostname validation from certificate DCV, which methods to choose, and when a custom hostname is ready for HTTPS.
This page summarizes Cloudflare documentation on custom hostnames for SSL for SaaS: proving customer domain ownership, issuing TLS certificates through domain control validation (DCV), and knowing when traffic is safe to cut over.
Custom hostname: two validations before HTTPS works
Section titled “Custom hostname: two validations before HTTPS works”A custom hostname only works in production when two independent checks succeed.
Hostname validation and certificate validation use different tokens and API fields.
ownership_verificationandownership_verification_httpvalidate hostname ownership and affect the custom hostname status.ssl.validation_recordsvalidates certificate issuance and affectsssl.status.For production traffic, the hostname should have
status: active,ssl.status: active, and DNS that points to your SaaS target.
— Cloudflare, Hostname validation
| Concern | What it proves | API / UI signal | Customer action (typical) |
|---|---|---|---|
| Hostname validation | The customer owns the hostname | result.status → active |
Pre-validation TXT (_cf-custom-hostname.*) or HTTP challenge, or real-time CNAME to your SaaS target |
| Certificate validation (DCV) | A CA may issue TLS for that name | result.ssl.status → active |
Depends on ssl.method: HTTP, TXT, email, or Delegated DCV |
When you create a custom hostname, plan both flows up front:
Certificate validation: Upon successful validation, the certificates are deployed to Cloudflare’s global network. Hostname validation: Upon successful validation, Cloudflare proxies traffic for this hostname.
You must complete both these steps for the hostname to work as expected.
— Cloudflare, Configuring Cloudflare for SaaS
Production readiness: result.status and result.ssl.status
Section titled “Production readiness: result.status and result.ssl.status”Treat a custom hostname as ready for production HTTPS only when hostname activation, certificate deployment, and DNS routing align.
| API field | Meaning | Ready value |
|---|---|---|
result.status |
Hostname activation (ownership / routing validation) | active |
result.ssl.status |
Certificate issuance and edge deployment | active |
— Cloudflare, Common API Calls
Treat the custom hostname as ready for production HTTPS when
result.statusisactive,result.ssl.statusisactive, and the customer’s DNS points to your CNAME target or apex proxying target.If
result.statusisactivebutresult.ssl.statusis notactive, the hostname is active but its certificate has not completed issuance and deployment. A successful TLS handshake alone does not mean the custom hostname certificate has finished provisioning because Cloudflare may present another matching certificate for that hostname.
— Cloudflare, Common API Calls
Use the Custom hostname details endpoint (GET /v4/zones/:zone_id/custom_hostnames/:custom_hostname_id) as the source of truth—not a one-off successful TLS handshake. Monitor certificate lifecycle stages in Certificate statuses (Initializing → Pending Validation → Pending Issuance → Pending Deployment → Active).
Hostname validation: pre-validation vs real-time validation
Section titled “Hostname validation: pre-validation vs real-time validation”Hostname validation answers whether Cloudflare may proxy the customer’s hostname on your SaaS zone. Methods fall into two strategies.
Pre-validation (TXT or HTTP ownership tokens)
Section titled “Pre-validation (TXT or HTTP ownership tokens)”Pre-validation verifies ownership before the customer’s traffic is proxied through Cloudflare—useful when downtime must be near zero.
Pre-validation methods help verify domain ownership before your customer’s traffic is proxying through Cloudflare.
— Cloudflare, Pre-validation
- TXT: Customer adds
ownership_verificationname/value (for example_cf-custom-hostname.app.example.com). - HTTP: Customer serves
ownership_verification_httpathttp_url(User-Agent:Cloudflare Custom Hostname Verification).
Real-time validation (DNS cutover triggers checks)
Section titled “Real-time validation (DNS cutover triggers checks)”Real-time validation runs when the customer adds the DNS record that points to your SaaS target (CNAME or apex proxying). It reduces customer steps but can introduce brief downtime while validation and backoff timers run.
Real-time validation methods put less burden on your customers because it does not require any additional actions.
However, it may cause some downtime since Cloudflare takes a few seconds to iterate over DNS records. This downtime also can increase - due to the increasing validation backoff schedule - if your customer takes additional time to add their DNS routing record.
— Cloudflare, Real-time validation
To reset hostname validation backoff while waiting on DNS, Cloudflare suggests sending no-change PATCH requests on the custom hostname until it validates—see Real-time validation.
Hostname validation backoff and terminal statuses
Section titled “Hostname validation backoff and terminal statuses”After you create a custom hostname, hostname validation retries follow a capped exponential schedule: 75 attempts over seven days, then the hostname is deleted if still unsuccessful. The first ten checks finish within about 20 minutes; intervals cap at four hours. See Backoff schedule.
Hostname status |
Meaning |
|---|---|
Pending |
Awaiting hostname validation |
Active |
Hostname validation complete |
Moved |
No longer points at fallback / validation window ended |
Deleted |
Removed; Moved for more than seven days |
Blocked |
Cannot be added (abuse hold, zone hold, etc.) |
— Cloudflare, Validation status
Certificate validation (DCV): choosing http, txt, or Delegated DCV
Section titled “Certificate validation (DCV): choosing http, txt, or Delegated DCV”When you create a custom hostname, pick one ssl.method: http, txt, or email. See Validate certificates.
HTTP validation (automatic vs manual)
Section titled “HTTP validation (automatic vs manual)”HTTP validation for custom hostnames suits providers who accept a short post-DNS-cutover window:
If you value simplicity and your customers can handle a few minutes of downtime, you can rely on Cloudflare automatic HTTP validation.
Once you create a new hostname and choose the
httpvalidation method, all your customers have to do is add a CNAME to your$CNAME_TARGETand Cloudflare will take care of the rest.
— Cloudflare, HTTP validation (SaaS)
Automatic HTTP serves the CA token from the edge once DNS points to your SaaS target. Manual HTTP requires placing http_body at http_url on the origin (see the same doc). Wildcard custom hostnames cannot use HTTP DCV—use TXT or Delegated DCV per HTTP validation (SaaS) and TXT validation (SaaS).
TXT validation and token lifetime
Section titled “TXT validation and token lifetime”TXT validation is appropriate when you need the certificate before DNS cutover, for wildcards, or when HTTP is unavailable. Share every record in ssl.validation_records; wildcard hostnames often need two _acme-challenge TXT values.
DCV token validity depends on the certificate authority:
| Certificate authority | DCV token validity |
|---|---|
| Let’s Encrypt | 7 days |
| Google Trust Services | 14 days |
| SSL.com | 14 days |
— Cloudflare, Token validity periods
With SSL.com, Cloudflare orders separate RSA and ECDSA certificates; satisfy all TXT records returned—see Troubleshooting certificate validation.
Delegated DCV (one-time CNAME for renewals)
Section titled “Delegated DCV (one-time CNAME for renewals)”Delegated DCV for custom hostnames lets customers place a one-time _acme-challenge CNAME so Cloudflare can place and rotate TXT tokens for future orders:
DCV Delegation requires your customers to place a one-time record at their authoritative DNS that allows Cloudflare to auto-renew all future certificate orders, so that there is no manual intervention from you or your customers at the time of the renewal.
— Cloudflare, Delegated DCV (SaaS)
Remove conflicting _acme-challenge TXT records before delegating; they block delegation. Verify the CNAME with:
dig _acme-challenge.example.com CNAME +shortDCV retry schedule (certificates)
Section titled “DCV retry schedule (certificates)”Certificate DCV retries use a separate backoff table (up to 120 attempts at four-hour spacing for edge certificates; custom hostnames follow the same pattern described in Validation backoff schedule). After failure, ssl.status may become validation_timed_out; restart with a configuration-neutral PATCH on Edit custom hostname—echo ssl.method, ssl.type, and ssl.settings exactly from a GET response. Details: Troubleshooting certificate validation.
On renewal, Cloudflare may switch methods: HTTP can run even if you chose TXT at creation, unless Delegated DCV keeps the flow TXT-based. See Renew certificates.
Zero-downtime migration and switching SaaS providers
Section titled “Zero-downtime migration and switching SaaS providers”For customers already live elsewhere, Zero-downtime migration recommends:
- Create the custom hostname via API.
- Pre-validate ownership (TXT or HTTP ownership token) until
result.statusisactive. - Pre-issue the certificate (Delegated DCV, TXT, or manual HTTP DCV) until
result.ssl.statusisactiveif TLS errors during cutover are unacceptable. - Update the customer CNAME to your fallback origin.
When moving between SaaS providers, multiple providers can hold an active custom hostname; DNS CNAME target decides routing. Prefer a specific hostname over a wildcard on the new provider if an old provider still has an exact match—see Certificate and hostname priority and Troubleshooting.
Common mistakes: zone holds, CAA, blocked DCV paths, error 1016
Section titled “Common mistakes: zone holds, CAA, blocked DCV paths, error 1016”Enterprise zone holds
Section titled “Enterprise zone holds”Zone holds block another account (or SaaS onboarding) from using names under a held zone. With Also prevent subdomains, custom hostname verification fails with a terminal Blocked status until the hold is released and validation is refreshed:
The Blocked status is terminal — the custom hostname will not retry validation automatically. After the zone hold is released, select Refresh on the custom hostname in the Cloudflare dashboard, or send a PATCH request to the custom hostname, to restart the validation process.
— Cloudflare, Troubleshooting (SaaS reference)
The same pattern affects SaaS customer guides (for example BigCommerce): temporarily disable the hold (or only Also prevent Subdomains for subdomain onboarding), refresh the custom hostname, then re-enable if needed.
CAA records and CA errors
Section titled “CAA records and CA errors”Restrictive CAA records at the hostname or parent domain can block issuance. Customers may need records allowing letsencrypt.org, pki.goog, and ssl.com (and issuewild variants). CA errors surface in ssl.validation_errors on the custom hostname object—see the responsibility table in Troubleshooting certificate validation.
Workers, Access, and redirects on /.well-known/*
Section titled “Workers, Access, and redirects on /.well-known/*”HTTP DCV and Pages custom domains fail when products intercept validation paths:
Pages uses HTTP validation and needs to hit an HTTP endpoint during validation. If another Cloudflare product is in the way (such as Access, a redirect, a Worker, a WAF custom rule, or a Client-Side Security content security rule), validation cannot be completed.
— Cloudflare, Debugging Pages
SaaS zones using a Worker as fallback origin must pass through /.well-known/pki-validation/* and /.well-known/acme-challenge/*. Partial setups must not redirect HTTP to HTTPS on those paths—see Troubleshooting DCV.
Error 1016 (origin DNS)
Section titled “Error 1016 (origin DNS)”Error 1016 often means hostname validation is incomplete, fallback origin is missing, or a standalone Cloudflare zone beats a wildcard custom hostname. Confirm fallback DNS, add explicit custom hostnames instead of relying only on wildcards when needed, and verify verification_errors via API.
API hygiene after creation
Section titled “API hygiene after creation”The Create custom hostname POST may omit validation_records initially; GET again after a short delay. To restart DCV without changing settings, PATCH with an ssl object matching the current GET. Deleting a custom hostname also deletes associated certificates.
How to check this on your site
Section titled “How to check this on your site”- In the Cloudflare dashboard, open Custom Hostnames for your SaaS zone and confirm the hostname shows Active for both hostname and certificate status, or call the Custom hostname details endpoint and verify
result.statusandresult.ssl.statusareactive. - From the customer’s perspective, confirm their CNAME (or apex record) points to your documented SaaS target as described in Getting started and Common API Calls.
- If certificate status is
pending_validation, inspectssl.validation_recordsandssl.validation_errorsusing Troubleshooting certificate validation; for Delegated DCV, rundig _acme-challenge.<hostname> CNAME +shortper Delegated DCV (SaaS). - If hostname validation stalls, compare timing against Backoff schedule and Validation status; refresh via dashboard Refresh or PATCH per Validation status.
- You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact statement you are asking about, and we will correct or clarify it.