# How do I use cloudflare DNS with a Netlify custom domain

**URL:** <https://answers.netlify.com/t/how-do-i-use-cloudflare-dns-with-a-netlify-custom-domain/1557>\
**Category:** Support\
**Tags:** netlify-dns-https-ssl\
**Created:** [June 20, 2019, 2:13pm UTC](https://answers.netlify.com/t/how-do-i-use-cloudflare-dns-with-a-netlify-custom-domain/1557 "2019-06-20T14:13:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajeet](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/ajeet/32/1344_2.png) [@ajeet](https://answers.netlify.com/u/ajeet)\
**Post date:** [June 20, 2019, 2:13pm UTC](https://answers.netlify.com/t/how-do-i-use-cloudflare-dns-with-a-netlify-custom-domain/1557/1 "2019-06-20T14:13:01Z")

</div>

Hi,

I am trying to set to custom domain in netlify. There are some questions posted in this forum as well but that does not solve my issue. here is what I did:

1. Added custom domain: www.thenewspaper.tech  
( Note: I added thenewspaper.tech but netlify suggested to use www as primary domain.
2. In my Custom Domain Panel in Netlify, I see three rows:  
(a) Default subdomain : one that is issued with `mydomain.netlify.com`  
(b) www.thenewspaper.tech as Primary domain : Here I see Check DNS Configuration Button clicking on which I see a pop up saying “point www CNAME record” and the step is to add `www CNAME mydomain.netlify.com.` I have already done this in Cloudflare in DNS Tab  
(c) thenewspaper.tech - Redirects automatically to primary domain : Here I see Check DNS Configuration Button clicking on which I see a pop up saying “There are two options. Recommended is point ANAME or ALIAS record to `mydomain.netlify.com`” and the step is to add `thenewspaper.tech ALIAS mydomain.netlify.com..`

Now, How do I set up the Step 2(c) in Cloudflare DNS tab. I don’t want to use Netlify CDN for now at least. Here are my CF crypto and page rules setting:

 ![crypto](https://global.discourse-cdn.com/netlify/original/2X/1/167cc5be48ec2e00325d425b1123d135b5f545e0.png)  
Page rule setting is:  
Rule1:  
www.thenewspaper.tech/\*  
The settings are : Forwarding URL 301 Permanent Redirect: [https://thenewspaper.tech/$1](https://thenewspaper.tech/%241)  
Rule 2: /thenewspaper.tech/\* Cache Level: Cache Everything, Edge Cache TTL 14 Days.

Can someone please help me here.

Thanks,  
Ajeet

---

<div class="post-metadata">

**Author:** ![perry](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/perry/32/16_2.png) [@perry](https://answers.netlify.com/u/perry)\
**Post date:** [June 20, 2019, 6:14pm UTC](https://answers.netlify.com/t/how-do-i-use-cloudflare-dns-with-a-netlify-custom-domain/1557/2 "2019-06-20T18:14:08Z")

</div>

Hi Ajeet,

did you have a look through these articles:

> [@\[Support Guide\] What problems could occur when using Cloudflare in front of Netlify?](https://answers.netlify.com/t/common-issue-why-isn-t-my-ssl-certificate-provisioning-automatically-with-cloudflare-netlify-are-there-other-problems-with-using-cloudflare-in-front-of-netlify/138):
>
> Last reviewed by Netlify Support - August, 2023 Note: We recommend not using both Cloudflare’s CDN (“Accelerate and Protect”, the orange cloud in their UI) and Netlify for the same site at the same time. Why? Read on! Netlify’s web service is not designed to work optimally with another CDN “in front of” our CDN. [Proxying to our service is in general not supported](https://answers.netlify.com/t/support-guide-why-not-proxy-to-netlify/8869) and we advise you not to do it for best hosting results. Cloudflare has made similar statements that it doesn’t recommend this usa…

> [@\[Support Guide\] Which are some good DNS providers for ALIAS/ANAME support?](https://answers.netlify.com/t/common-issue-which-are-some-good-dns-providers-for-alias-aname-support/211):
>
> Last reviewed: Aug 2023 There is a limited set of DNS providers that we know have functional support for records compatible with using your apex domain with our [Content Delivery Network](https://en.wikipedia.org/wiki/Content_delivery_network) (CDN). We recommend our own DNS hosting backed by NS1, but customers have also used [Flattened CNAME records at CloudFlare](https://blog.cloudflare.com/introducing-cname-flattening-rfc-compliant-cnames-at-a-domains-root/) successfully. However - if you do use Cloudflare’s DNS, please [be careful not to use their CDN in front of ours](https://answers.netlify.com/t/support-guide-why-isn-t-my-ssl-certificate-provisioning-automatically-with-cloudflare-netlify-are-there-other-problems-with-using-cloudflare-in-front-of-netlify/138)! By the way, as a reminder: our own DNS hosting works extremely well with our…

?

---

<div class="post-metadata">

**Author:** ![ajeet](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/ajeet/32/1344_2.png) [@ajeet](https://answers.netlify.com/u/ajeet)\
**Post date:** [June 20, 2019, 7:27pm UTC](https://answers.netlify.com/t/how-do-i-use-cloudflare-dns-with-a-netlify-custom-domain/1557/3 "2019-06-20T19:27:23Z")

</div>

Hi @perry  
Thanks so much Sir 🙂 Seems like the issue is fixed…I wanted to do a tresting for a small site before recommending others. I went through all the articles on Netlify with CF. What the first article saying is I completely understand that I need to turn off the orange color to grey. What I did not understand was the CNAME/ALIAS thing. Earlier I tried adding two CNAMEs in DNS tab in CF but I did not know that I need to turn off color as well to grey.  
Seems like my site is up and running but I still I want to clarify a few things please.

In cloudflare settings:  
1. Can you please check if the settings are correct for DNS. I have added only 2 records ( there is also a notification in the image, is this a problem)

 ![Screenshot_3](https://global.discourse-cdn.com/netlify/original/2X/4/4b0a7b0c2d281821db20fac032d6b711910a3a4e.png)  
Also, I have this: CNAME Flattening as Flatten CNAME at root…  
Can you please verify of this settings in DNS is correct and will not conflict with Netlify ?  
2. In Crypto tab: I have ---- Full Strict SSL, Always use HTTPS, Automatic HTTPS Rewrites ON,-- Is this setting correct and will not conflict with Netlify ?  
3. In Page rule, I have only one rule: thenewspaper.tech/\* Cache Level: Cache Everything, Edge Cache TTL 14 Days. THis wont conflict with netlify ?

Thanks so much for the support so far .  
Ajeet

---

<div class="post-metadata">

**Author:** ![luke](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/luke/32/39_2.png) [@luke](https://answers.netlify.com/u/luke)\
**Post date:** [June 24, 2019, 9:31am UTC](https://answers.netlify.com/t/how-do-i-use-cloudflare-dns-with-a-netlify-custom-domain/1557/5 "2019-06-24T09:31:50Z")

</div>

For Cloudflare, I believe a CNAME on the bare domain _is_ effectively an ALIAS record:

> **[Introducing CNAME Flattening: RFC-Compliant CNAMEs at a Domain's Root](https://blog.cloudflare.com/introducing-cname-flattening-rfc-compliant-cnames-at-a-domains-root/)**
>
> This post is about a new feature we've been quietly rolling out over the last few months. Last week we began enabling it for everyone by default.

For the questions above I have the following answers:

> Can you please verify of this settings in DNS is correct and will not conflict with Netlify ?

Yes, this appear to be the correct settings to me.

> In Crypto tab: I have ---- Full Strict SSL, Always use HTTPS, Automatic HTTPS Rewrites ON,-- Is this setting correct and will not conflict with Netlify ?

It looks like this site is using Netlify’s SSL certificate. Also, all Netlify sites are SSL by default. I do think these settings are compatible with Netlify. However, I’m not sure if they apply as I don’t see Cloudflare serving the content (they appear to be doing DNS resolution only).

> In Page rule, I have only one rule: thenewspaper.tech/\* Cache Level: Cache Everything, Edge Cache TTL 14 Days. THis wont conflict with netlify ?

Again, I don’t think these apply at all because Netlify is serving the content and Cloudflare is doing DNS resolution only. (At least, that is what I see at the present time in my testing.)

If there are other questions, we’re happy to answer.

---

<div class="post-metadata">

**Author:** ![ajeet](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/ajeet/32/1344_2.png) [@ajeet](https://answers.netlify.com/u/ajeet)\
**Post date:** [June 25, 2019, 11:38pm UTC](https://answers.netlify.com/t/how-do-i-use-cloudflare-dns-with-a-netlify-custom-domain/1557/6 "2019-06-25T23:38:27Z")

</div>

Thanks @luke and @perry

---

<div class="post-metadata">

**Author:** ![ingr](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/ingr/32/3601_2.png) [@ingr](https://answers.netlify.com/u/ingr)\
**Post date:** [October 21, 2019, 7:38am UTC](https://answers.netlify.com/t/how-do-i-use-cloudflare-dns-with-a-netlify-custom-domain/1557/7 "2019-10-21T07:38:46Z")

</div>

Hi, Luke!

I have just transferred a domain to Cloudflare and I am trying to change DNS as you have described in the post, but it does work out.

 ![Cloudflare%20DNS](https://global.discourse-cdn.com/netlify/original/2X/0/05dc8147a2e9b5db5ad9bea9e6689a1e8a5e8066.png) SSL is off. Could you check, please.

Thank you for your time!

Maksim

---

<div class="post-metadata">

**Author:** ![fool](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/fool/32/37_2.png) [@fool](https://answers.netlify.com/u/fool)\
**Post date:** [October 25, 2019, 8:10pm UTC](https://answers.netlify.com/t/how-do-i-use-cloudflare-dns-with-a-netlify-custom-domain/1557/8 "2019-10-25T20:10:03Z")

</div>

You’ll need to turn off the “orange cloud” (we do not support being proxy’d to). This post has more details:

> [@\[Support Guide\] What problems could occur when using Cloudflare in front of Netlify?](https://answers.netlify.com/t/common-issue-why-isn-t-my-ssl-certificate-provisioning-automatically-with-cloudflare-netlify-are-there-other-problems-with-using-cloudflare-in-front-of-netlify/138):
>
> Last reviewed by Netlify Support - August, 2023 Note: We recommend not using both Cloudflare’s CDN (“Accelerate and Protect”, the orange cloud in their UI) and Netlify for the same site at the same time. Why? Read on! Netlify’s web service is not designed to work optimally with another CDN “in front of” our CDN. [Proxying to our service is in general not supported](https://answers.netlify.com/t/support-guide-why-not-proxy-to-netlify/8869) and we advise you not to do it for best hosting results. Cloudflare has made similar statements that it doesn’t recommend this usa…

Once you make that change, as mentioned in that article, wait 5 minutes and then hit the “verify DNS” button on the domain settings page and trigger a certificate generation on our side.
