Client cname pointing to my domain on cloudflare
Asked Answered
B

3

6

A client of ours has the domain client.com

Our application is at superapp.mycompany.com

We want the client to be able to access our application via their own subdomain, like: superapp.client.com.

Normally we'd just tell the client to add a cname for superapp and point it to superapp.mycompany.com. Then on our server (IIS) we'd bind their domain to our app and everything would work as intended.

However, we can't replicate this functionality when our mycompany.com domain is managed via cloudflare.

When we navigate to superapp.client.com we get the following error page:


Error 1001

What happened?

You've requested a page on a website (superapp.client.com) that is on the Cloudflare network. Cloudflare is currently unable to resolve your requested domain (superapp.client.com).


Is there any way that Cloudflare can be used in this fashion?, this seems like a pretty standard set up for a multi tenant application that supports custom domains.

We don't need all the protection that Cloudfront offers for these client domains, but we want to use the Cloudfront nameservers for out application (mainly for fast switching of DNS records in the event we migrate servers, etc).

Any help is appreciated.

Birdbath answered 22/4, 2017 at 2:8 Comment(3)
We have this EXACT same challenge. Can you please share if you ever found a solution here? Did you end up needing to move away from Cloudflare for DNS?Pansypant
We gave up on this, we managed to get the basics working by registering the client's address on cloudflare and then not verifying, but I wouldn't trust this setup in production. Even with this, SSL was a no go so we just moved on. I don't think cloudflare is made for users in our position. Never found a good solution, we're just using our bog standard DNS provider now (123-reg).Birdbath
@Pansypant if you're still interested in this question, I have added a solution to this.Aplanospore
A
3

I hope it's not too late. But just found a way to do so. You just need to add your client's domain (Add site in Cloudflare) to your account.

You don't need to change client domain's NS. So in your Cloudflare panel this domain will showing as "Pending Nameserver Update".

Next step is add the CName record to this domain.

Although the NS of client domain is not changed to CF, but CF has a lookup record as CName for it.

Hope it helps.

Aplanospore answered 20/9, 2018 at 11:6 Comment(4)
Thanks, looks like some kind of a hack but works like a charm. :)Oldfangled
Do you know if it is stil working ? We still have a 1001 error with this solution.Hightension
@MathieuFerre I realize your question is from a few months ago but the solution is working for us. You have to go to the client's domain in Cloudflare (the one showing "Pending Nameserver Update") - in the example above that would be "client.com" - and set up the CNAME record superapp.client.com pointing to superapp.mycompany.comCrackup
This workaround doesn't seem to work anymore.Bush
D
1

Just in case someone arrived here with same issue as me. Here is the answer. For short, no that won't work.

Since Cloudflare is a reverse proxy for the domain that is on Cloudflare, the CNAME redirect for the domain (not on Cloudflare) wouldn't know where to send the traffic to.

Ref: https://support.cloudflare.com/hc/en-us/articles/360017421192-Cloudflare-DNS-FAQ#CloudflareDNSFAQ-CanICNAMEadomainnotonCloudflaretoadomainthatisonCloudflare

Darciedarcy answered 15/8, 2018 at 13:41 Comment(1)
I can't access the link, I get a "You're not authorized to access this page" message (even after logging in).Bonnibelle
R
0

If you don't need the CDN benefits, you can still use Cloudflare nameservers to manage your DNS zone and keep your current configuration. Just make sure the CDN is deactivated for the target subdomain in your zone (superapp.mycompany.com in your case).

You can tell if the CDN is activated or deactivated for a subdomain by looking at the cloud icon on the right of each DNS entry: if the cloud is orange the CDN is active, if it is gray, it isn't.

Cloudflare also supports external CNAME resolution in their CDN infrastructure, but it's only available for its Enterprise customers:
https://support.cloudflare.com/hc/en-us/articles/217371987-Managed-CNAME

Rallentando answered 16/7, 2018 at 10:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.