r/CloudFlare: Question about pointing Cloudflare domain record to another Cloudflare domain that is using third-party name servers (Wix)?

r/CloudFlare: Question about pointing Cloudflare domain record to another Cloudflare domain that is using third-party name servers (Wix)?
💡
This article archives a conversation, which took place in a subreddit post (original source linked below) and to which I contributed a solution or answer (with the u/MasterofSynapse handle), in a Q&A format.

Original Reddit post: https://www.reddit.com/r/CloudFlare/comments/y1z28a/question_about_pointing_cloudflare_domain_record/

Question

I know Cloudflare doesn't allow you to make domain records which point to a different domain that is on the Cloudflare network, but If I set my Cloudflare domain 'ABC' to have Wix's nameservers would I be able to make a domain record on domain 'DEF' which points to domain 'ABC'?

Answer

Yes, and that has nothing to do with Cloudflare or anything else, CNAMEs are default DNS architecture. However you will run into certificate errors when using the ABC record since Wix will only know the DEF domain. A redirect is better here.

Comment 1 on Answer

A redirect to what? Wix surely have to have public IP's for their customer's sites but I can find no documentation related to it. My original plan was just to make a A/AAA name record on ABC domain which points to my Wix website IP as that seemed the easiest approach, but I could find no documentation on Wix's end to overview how to do that which is causing my to look into getting a new domain for my Wix site (something a bit more professional sounding) as I want to point my original domain to my home IP to setup a Cloudflare DDNS system (something I don't need to get into here). But I still want to be able to access my Wix site via a subdomain of my original domain.

I do hope this makes sense as the more I type the more confusing it sounded.

My response to comment 1

Wix doesn't want to have the feature you are describing. Any website builder out there wants to be able to know which domains point to a package, or else anyone could "mirror" your site to a different domain. What do you want to achieve by having a subdomain pointing to your website domain? What benefit does that bring? Just create a bookmark in your browser.

Comment 1.1 on Answer

Well originally my plan, which I glossed over in my previous message, was to set my domain 'ABC' to point to my home IP, with a few CName, A or AAA records pointed to specific devices I wanted to access externally from my house (PC's I can RDP into for example), and I wanted to set up a subdomain (which I think would be an A and/or AAA record) which pointed to my Wix site so the only domain for it would be something like 'Wix.ABC.com', but it's looking like that won't be possible. I know Wix has options to set up A, AAA and Cname records on domains connected to a Wix website but as far as I'm aware they don't have an API for users to update them and I've never seen an 'app' to dynamically update them like the Cloudflare DDNs script. If I end up just buying a new domain for my Wix site then I guess making a subdomain from the ABC domain link to it wouldn't be much use.

My response to comment 1.1

First up, try looking into Cloudflare Zero Trust to make the connections to your home network more secure. And second, why would Wix need DDNS? They supply you with records you have to create and then you are done. And that would have nothing to do with your DDNS setup, that is on a record-by-record basis.

Check their docs here (https://support.wix.com/en/article/connecting-a-domain-to-wix-using-the-pointing-method), you don't have to change your Nameservers.

Comment 1.2 on Answer

ooh, I didn't know pointing was even a thing. Wix's guide seems to suggest I can only have 1 A name and 1 Cname record if I use the pointing method. So ik I wouldn't be able to have two A name and 2 Cname records both pointing to the `www` but having a A or cname record but having both a A and Cname record of 'wix.ABC.com' pointing to the "targets" wix provides should work right?

My response to comment 1.2

I think you misunderstood the setup guide from them a bit. They supply you with one A and one CNAME record, what other records you have with your DNS provider doesn't interest them. They don't limit you to one A and one CNAME record.

And yes, if you input the subdomain you want into Wix and let them tell you the DNS records everything should work the way you want it to.

Comment 1.3 on Answer

It was this wording that probably took me down the wrong path. I've managed to add the A record but I keep getting a cloudflare error when I try to add the Cname record (ik that's not the URL in the original guide). I don't think I've put anything identifiable in here but I'll still delete those imgs in a few hours.

My response to comment 1.3

You are getting the error on the CNAME creation since a DNS record name has to be unique, and you used "portfolio" for your A record already.

And Wix wants you to add a www CNAME record, so just use "www.portfolio" as the CNAME record name and it will work.

Please run through the assistant in your Wix account since I am sure the DNS record values will differ from the guide.