Hubspot and Cloudflare DNS Question

SOLVE
Occasional Contributor

Hello, 

 

I recently took control of a site hosted here and would like to switch the DNS over to Cloudflare. My records imported and I have a CNAME that points to my Hubspot URL. I'm wondering about best practices but specifically how the 301 redirect from the root domain is handled. The CNAME record for www does not allow it to be "orange clouded" which is required for you to set up a page rule in Cloudflare that will allow you to 301 the root to www. Right now, we have an A record set up that is useless that simply allows us to use a page rule on the root domain. I was hoping a flattened CNAME could be used. Does anyone have any experience or best practices with using Cloudflare and Hubspot? Thanks in advance!

 

growww.pngBecause of this, the CNAME cannot be orange clouded which turns on the HTTP proxy in Cloudflare.grow2.png

 

 

Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Esteemed Contributor

Hi @jgrowteam

 

Based on my experience, you cannot use the root domain in HubSpot. Plus, HubSpot cannot automatically redirect your root domain to the www version. As you mentioned, you've to leverage the Cloudflare page rules. Here's the HubSpot guide to set up your CNAME & redirection.

 

This is what I do:

  • Set up A record in Cloudflare
  • Set up CNAME that points to HubSpot
  • Set up Page Rules in Cloudflare for 301 redirection
    • I'd suggest using both http & https version redirected to https://www version; Now Cloudflare will resolve both http & https for you and redirect you to the https version of your www site.Screen Shot 2018-11-06 at 1.38.32 PM.png

       

Thanks.

Aakar Anil
Marketing Technologist
aakar.me | @aakarpost | in/aakarpost
11 Replies 11
Community Superstar

>>I recently took control of a site hosted here and would like to switch the DNS over to Cloudflare. 

 

As you probably already know, HubSpot runs on Amaz0n Web Services (AWS) in the United States East region, and HubSpot leverages the Google Cloud Platform (GCP) in the EU (Frankfurt, Germany region).

- see HubSpot Cloud Infrastructure | Frequently Asked Questions

- see Introducing HubSpot CMS

 

Not even certain it's possible to move a HubSpot hosted site to another CDN. Obviously, doing so we'd expect to lose any infrastructure security protections offered by HubSpot's CDN including DDoS Attack mitigation and Web Application Firewall. Also we'd expect to lose HubSpot's 99.999% uptime SLA.

 

Seems like a lot to pay for and not use. In fact, it's one of the primary reasons we recommend HubSpot to clients for blogging over WordPress! All of the headaches that come with a 'free', open source platform are eliminated (to the extent possible) when using HubSpot.

 

Best bet is to reach out to your Customer Success Manager. 

Hope that helps.

 

Best,
Frank

 

MFrankJohnson-dot-com-HubSpot-Community-banner-gif-v20190817

Reply
0 Upvotes
Occasional Contributor

Thanks for the reply Frank! Our intention was to use cloudflare to manage the DNS only instead of GoDaddy since that is where we control other domains. You can use cloudflare without using their CDN. And from some of the only other info I found about Cloudflare and Hubspot, Hubspot uses them for their CDN and SSL certificates. 

 

https://www.cloudflare.com/case-studies/hubspot/

Community Superstar

Ahh. I see what you're trying to do. Can't say we've seen this before, but your CSM should be able to direct you to the correct HubSpot Infrastructure people. They'd be able to tell you immediately.

 

Would be interested in knowing how it turns out.

Hope that helps.

 

Best,
Frank

 

MFrankJohnson-dot-com-HubSpot-Community-banner-gif-v20190817

Reply
0 Upvotes
Community Thought Leader | Diamond Partner

Hi @jgrowteam

 

After reading this article on the development forum: Setting Root Domain Redirect from Cloudflare to HubSpot Subdomain a client of ours was able to redirect both the http and https root domains to HubSpot using Cloudflares page rules. 

 

I was not involved directly in the configuration so, unfortunatly, I do not have any more detailed information to share, but hopefully this points you in the right direction. 

 

Hope this helps.

Phil Vallender | Inbound marketing for B2B technology companies
Reply
0 Upvotes
Esteemed Contributor

Hi @jgrowteam

 

Based on my experience, you cannot use the root domain in HubSpot. Plus, HubSpot cannot automatically redirect your root domain to the www version. As you mentioned, you've to leverage the Cloudflare page rules. Here's the HubSpot guide to set up your CNAME & redirection.

 

This is what I do:

  • Set up A record in Cloudflare
  • Set up CNAME that points to HubSpot
  • Set up Page Rules in Cloudflare for 301 redirection
    • I'd suggest using both http & https version redirected to https://www version; Now Cloudflare will resolve both http & https for you and redirect you to the https version of your www site.Screen Shot 2018-11-06 at 1.38.32 PM.png

       

Thanks.

Aakar Anil
Marketing Technologist
aakar.me | @aakarpost | in/aakarpost
Highlighted
Occasional Contributor

Thanks a lot. Just in case anyone has a question later as to what A record to use. It doesn't matter what A record that you use. The page rule will override it and redirect it to the WWW CNAME record. 

Reply
0 Upvotes
New Contributor

Is the *.domain.com necessary? We have another software that is using that record.

Reply
0 Upvotes
Esteemed Contributor

No, not needed @andy_gh. You can set it up for your HubSpot domains only. 

Aakar Anil
Marketing Technologist
aakar.me | @aakarpost | in/aakarpost
New Contributor

How do you leverage Cloudflare page rules when the CNAME can't be proxied through cloudflare? It only allows the option of `DNS only` under Proxy Status.

Reply
0 Upvotes
Occasional Contributor

Hi Jona,

 

Is the reason your cname cannot be proxied because you don't have an A record for your root domain? If that is the case, enter a dummy A record and then use the page rules to do your redirect. Not elegant but it is what I had to do. 

Reply
0 Upvotes
New Contributor

Thanks for the reply!

 

I have an A record for the root domain. I set it up using the instructions below:

Screen Shot 2019-10-03 at 8.58.54 AM.png

 

You also have to add the CNAME for `www` that points to `

XXX.groupXXX.sites.hubspot.net`. This CNAME is not allowed to be proxied through cloudflare so when a request comes in for `www.example.com`, it doesn't take advantage of any page rules or workers.

 

Let me know if you need any other details.

 

Thanks!

Reply
0 Upvotes