How to configure DNS for CNAME (partial setup) when managing DNS externally

This KB article is designed for partners who want to add domains on CNAME setup and use the Cloudflare Partner (Host) API while managing their authoritative DNS externally. 

Here are the two cases when the original domain (e.g. www.example.com) record is an A record or a CNAME record. These two types of records have slightly different requirements.

Please note that to obtain the SSL certificate for domains on CNAME partial setup, you need to follow these steps.

A record example

Existing DNS record without Cloudflare: www.domain.com A record to IP address

www.example.com points to A record 46.22.22.23

You need to make the following update to your DNS. This means that your subdomain traffic will start flowing through Cloudflare: 

www.example.com points to CNAME record www.example.com.cdn.cloudflare.net

Additionally, you need to add one more record to point back to your origin: 

cloudflare-resolve-to.www.example.com A record 46.22.22.23

If you want to add other subdomains on Cloudflare you follow the same logic:
Example, blog.example.com

Existing DNS record: without Cloudflare

blog.example.com points to A record IP address

Update with New DNS records: with Cloudflare

blog.example.com points to CNAME record blog.example.com.cdn.cloudflare.net

Additionally, you need to add one more record to point back to your origin:   

cloudflare-resolve-to.blog.example.com A record IP address

If both subdomains originally are pointed to the same IP address then it should be fine to create just one cloudflare-resolve-to DNS record in following format:

cloudflare-resolve-to.example.com A record IP address

 

CNAME example

Let's take the subdomain www.example.com, using CNAME as the DNS record. To add www.example.com to Cloudflare:

Existing DNS - without Cloudflare: 
www.example.com is pointed to the CNAME record example.com

You need to make the following update to your DNS. This means that your subdomain traffic will start flowing through Cloudflare: 

www.example.com points to the CNAME record www.example.com.cdn.cloudflare.net

Additionally, you need to add one more record to point back to your origin: 

cloudflare-resolve-to.www.example.com CNAME record to example.com

If you want to add other subdomains on Cloudflare you follow the same logic:
Example, blog.example.com

Existing DNS record: without Cloudflare

blog.example.com points to CNAME record example.websitebuilder.com

Update with the new DNS record: with Cloudflare

blog.example.com points to the CNAME record example.websitebuilder.com.cdn.cloudflare.net

Additionally, you need to add one more record to point back to your origin:   

cloudflare-resolve-to.blog.example.com CNAME example.websitebuilder.com

If both subdomains originally are pointed to the same CNAME then it should be fine to create just one cloudflare-resolve-to DNS record in following format:

cloudflare-resolve-to.example.com CNAME record example.com

 

Still not finding what you need?

The Cloudflare team is here to help. 95% of questions can be answered using the search tool, but if you can’t find what you need, submit a support request.

Powered by Zendesk