Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Is it possible to point a host to a CNAME record on Cloudflare?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Is it possible to point a host to a CNAME record on Cloudflare?

Let's say I have a cname called host01.cname.com which is hosted with cloudflare and I want to point 3 websites eg web1.domain1.com, web2.domain2.com and web3.domain3.com to host01.cname.com is it possible with cloudflare?

In this case the domainX domains will be on my own nameservers rather than clouldflare's.

If Cloudflare's system does not permit that, will using cloudflare to host the DNS for domain1.com, domain2.com and domain3.com enable it work?

Comments

  • I dont think it will work since those domainx.com dns arent managed by cloudflare? Do it on the control panel of those domains?

    Also this can be done using htaccess I think?

  • dominamedominame Member
    edited April 2020

    Does the server you are wanting to host the three domains on have a hostname? If not, and only if not, call it host01 and point host01.cname.com at its IP address with an A record (AAAA too is OK if you have IPv6). You do this within the DNS zone of cname.com. No need to set up a separate CNAME record.

    Now you can host whichever domains you wish on it, just set up their A records correctly.

    Just one gotcha to be aware of: You need authoritative and recursive DNS servers. If what you have of your own and at cloudflare are auth, I suggest installing something like Unbound locally. That will entail overriding resolv.conf - you may have some reading to do :)

  • SaahibSaahib Host Rep, Veteran

    If you can control DNS of web1.domain1.com , web2.domain2.com , web3.domain3.com , then simply make a cname entry for each of above there pointing to host01.cname.com .
    It will work.

  • @dominame said:
    Does the server you are wanting to host the three domains on have a hostname? If not, and only if not, call it host01 and point host01.cname.com at its IP address with an A record (AAAA too is OK if you have IPv6). You do this within the DNS zone of cname.com. No need to set up a separate CNAME record.

    Now you can host whichever domains you wish on it, just set up their A records correctly.

    Just one gotcha to be aware of: You need authoritative and recursive DNS servers. If what you have of your own and at cloudflare are auth, I suggest installing something like Unbound locally. That will entail overriding resolv.conf - you may have some reading to do :)

    What I want to be certain of it will work with cloudflare. If Cloudflare is running a proxy then I assume that as the hostnames web1.domain1.com etc are not proxied by cloudflare the cloudflare proxy will not accept them, even if the CNAME host01.cname.com is proxied by clouldflare.

    When the DNS server returns the host01.cname.com to the web browser, does the web browser pass on the CNAME as well as the website hostname to the proxy? eg if the IP is 1.1.1.1 does the web browser send both host01.cname.com and web1.domain.com for the proxy for it to know that web1.domain.com should be forwarded to the host for host01.cname.com

    When I read the Cloudflare docs it says that CNAMES can only be setup for business accounts

  • dominamedominame Member
    edited April 2020

    From your OP, host01.cname.com is on Cloudflare so the cname.com is there too, which means you have a DNS zone on a Cloudflare authoritative nameserver.
    The other three are on your own nameservers. Your objective is to run websites off a machine with hostname host01 fqdn host01.cname.com.
    Is that correct?
    Is 1.1.1.1 authoritative, recursive or is it the IP of your server?
    Are your own DNS servers authoritative or recursive?

    Thanked by 1rchurch
  • As said earlier this depends on where the dns of these domainx are managed. Since they arent on cloudflare, go to their respective hosting/registrar panel and create the cname there to target/value host01.cname.com

    Thanked by 1dominame
  • rchurchrchurch Member
    edited April 2020

    @dominame said:
    From your OP, host01.cname.com is on Cloudflare so the cname.com is there too, which means you have a DNS zone on a Cloudflare authoritative nameserver.
    The other three are on your own nameservers. Your objective is to run websites off a machine with hostname host01 fqdn host01.cname.com.
    Is that correct?
    Is 1.1.1.1 authoritative, recursive or is it the IP of your server?
    Are your own DNS servers authoritative or recursive?

    1.1.1.1 is the IP address of the Cloudflare proxy.

    domainX.com are configured on my registrars DNS server with their CNAMES pointing to host01.cname.com which is on cloudflare.

    Anyway I tried it and it doesn't work. Cloudflare produces an error message. It looks like cloudflare expects all the domains it proxies to be configured in the own DNS.

    Their Business and Enterprise are the ones which enable you to point your DNS entries on your own DNS to CNAMES on Cloudflare.

    Understanding a CNAME Setup – Cloudflare Help Center

    CNAME setup is available to paid Cloudflare plans at the Business or Enterprise level.

    A CNAME setup allows a customer to maintain authoritative DNS outside of Cloudflare. It allows individual subdomains to benefit from Cloudflare's services without requiring updates for a domain's registration to point to Cloudflare's nameservers for DNS resolution.

  • Im trying to recreate in DA with value to a subdomain on DA/cPanel and Cloudflare to test

    The DA value always becomes host01.cname.com.domainx.com . Why does it always append the parent domain to the cname value @smtalk @DA_Mark

    Wouldn't there also be a problem when using cname method for domain control validation due to this?

  • smtalksmtalk Member

    @timelapse said:
    Im trying to recreate in DA with value to a subdomain on DA/cPanel and Cloudflare to test

    The DA value always becomes host01.cname.com.domainx.com . Why does it always append the parent domain to the cname value @smtalk @DA_Mark

    Wouldn't there also be a problem when using cname method for domain control validation due to this?

    Just add a dot at the end :smile: It'll not append anything to the end then. It's just how bind/named works. Sorry for the confusion.

    Thanked by 1rchurch
  • rchurch said:

    When the DNS server returns the host01.cname.com to the web browser, does the web browser pass on the CNAME as well as the website hostname to the proxy?

    no it'll ask for the pages at web.domainx.com and not refer to host01.cname.com at all in its requests to the web server.

    yes if cloudflare relies on the host header as a key in its cache then it won't be able to serve cached pages. you will have to use cloudflare dns as the authoritative nameservers for domainx.com so that it knows that requests for pages at these domains are also to be cached.

Sign In or Register to comment.