How do I use cloudflare DNS with a Netlify custom domain

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:


Page rule setting is:
Rule1:
www.thenewspaper.tech/*
The settings are : Forwarding URL 301 Permanent Redirect: https://thenewspaper.tech/$1
Rule 2: /thenewspaper.tech/* Cache Level: Cache Everything, Edge Cache TTL 14 Days.

Can someone please help me here.

Thanks,
Ajeet

Hi Ajeet,

did you have a look through these articles:

?

Hi @perry
Thanks so much Sir :slight_smile: 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)


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

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

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.

1 Like

Thanks @luke and @perry

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.

SSL is off. Could you check, please.

Thank you for your time!

Maksim

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

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.