Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Client cname pointing to my domain on cloudflare

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.

like image 765
Benjimoon Avatar asked Apr 22 '17 02:04

Benjimoon


People also ask

Can a CNAME record point to a URL?

No, CNAME records only point to other address records. These only cover the hostname part of the URL. To redirect a domain name to a URL, you need to point the DNS record to a web server configured for that domain name, and then make it issue an HTTP Redirect to the correct URL.

How does CNAME work Cloudflare?

A partial ( CNAME ) setup allows you to use Cloudflare's reverse proxy while maintaining your primary and authoritative DNS provider. Use this option to proxy only individual subdomains through Cloudflare's global edge network when you cannot change your authoritative DNS provider.


1 Answers

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.

like image 121
Steven.Xi Avatar answered Sep 27 '22 22:09

Steven.Xi