Two domains in Cloudflare - CNAME of one pointing to other

We have two different domains in two DIFFERENT accounts in Cloudflare
example1
example2

DNS has been transferred to Cloudflare for both accounts and everything is working properly.

we want though www.example2.com to point to test.example1.com

How can we accomplish that and what type of account is required?

You can only do this if test.example1.com is not proxied but resolves to the actual IP address. In that case you can simply create a CNAME, keep in mind you will still have to configure your server to accept the second hostname (www.example2.com) as well.

Thank you Sandro, yes, this would work. Server also responds to second hostname.
However how should we go if we want Cloudflare to proxy the traffic?

As I said, that is not possible. It might be possible if they are under the same account, but you should verify that first.

If you attempt it, you will get a 1014 error.

Just to add to what @sandro said, it may be possible on a Pro plan or above, by contacting support, but is not possible on Free.

By default, Cloudflare prohibits a DNS CNAME record between domains in different Cloudflare accounts. CNAME records are permitted within a domain ( www.example.com CNAME to api.example.com ) and across zones within the same user account ( www.example.com CNAME to www.example.net ).

Resolution

To allow CNAME record resolution to a domain in a different Cloudflare account, the domain owner of the CNAME target must contact Cloudflare Support and specify the domains allowed to CNAME to their target domain. A Cloudflare Pro, Business, or Enterprise plan is required on the target domain for Cloudflare Support to change default CNAME restrictions.

https://support.cloudflare.com/hc/en-us/articles/360029779472-Troubleshooting-Cloudflare-1XXX-errors#error1014

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.