Pre-validation
Pre-validation methods help verify domain ownership before your customer’s traffic is proxying through Cloudflare.
Use pre-validation methods when your customers cannot tolerate any downtime, which often occurs with production domains.
The downside is that these methods require an additional setup step for your customers. Especially if you already need them to add something to their domain for certificate validation, pre-validation might make their onboarding more complicated.
If your customers can tolerate a bit of downtime and you want their setup to be simpler, review our real-time validation methods.
TXT validation is when your customer adds a TXT
record to their authoritative DNS to verify domain ownership.
To set up TXT
validation:
-
When you create a custom hostname, save the
ownership_verification
information. -
Have your customer add a
TXT
record with thatname
andvalue
at their authoritative DNS provider. -
After a few minutes, you will see the hostname status become Active in the UI.
-
Once you activate the custom hostname, your customer can remove the
TXT
record.
HTTP validation is when you or your customer places an HTTP token on their origin server to verify domain ownership.
To set up HTTP validation:
When you create a custom hostname using the API, Cloudflare provides an HTTP ownership_verification
record in the response.
To get and use the ownership_verification
record:
-
Make an API call to create a Custom Hostname.
-
In the response, copy the
http_url
andhttp_body
from theownership_verification_http
object: -
Have your customer place the
http_url
andhttp_body
on their origin web server.Cloudflare will access this token by sending
GET
requests to thehttp_url
usingUser-Agent: Cloudflare Custom Hostname Verification
. -
After a few minutes, you will see the hostname status become Active in the UI.
-
Once the hostname is active, your customer can remove the token from their origin server.