This article describes the process of configuring a CNAME setup at Cloudflare.
Task 1 - Activating CNAME setup for a domain
Review our guide that explains the benefits and limitations of a CNAME setup.
- Create a Cloudflare account and add your website.
- Contact Cloudflare Support to request allowance of a CNAME setup for a specific domain. Mention CNAME setup for <domain> in the subject line.
- Cloudflare Support will confirm the CNAME setup has been enabled.
- A TXT record will appear in the Cloudflare Dashboard Overview app. Add the TXT record to your authoritative DNS.
- After a few hours, Cloudflare will have verified the TXT record and sent a confirmation email.
- Provision Universal SSL for the domain.
Task 2 - Provision Cloudflare Universal SSL for CNAME setup
Cloudflare's Universal SSL certificate will be deployed once a domain is activated on the CNAME setup and proper Domain Control Validation (DCV) records have been added to authoritative DNS:
- Fetch DCV records from the Cloudflare API.
- Add the DCV records as CNAME records within the domain's authoritative DNS (not the Cloudflare DNS app).
- Add DNS records for the CNAME setup.
Task 3 - Adding DNS records to a CNAME setup
Once a CNAME setup is enabled, DNS records must be updated in both Cloudflare's DNS app and your authoritative DNS:
- Add an A or CNAME record in the Cloudflare DNS app for the subdomain.
- Edit the corresponding CNAME record in your authoritative DNS to append .cdn.cloudflare.net to the hostname.
For example, when configuring www.example.com on a CNAME setup with Cloudflare, the CNAME record in authoritative DNS would need to point to www.example.com.cdn.cloudflare.net.
www.example.com CNAME www.example.com.cdn.cloudflare.net
CNAME records can be added to your authoritative DNS for each subdomain to be proxied to Cloudflare.