[Feature] Cloudflare improvements (now with A Records!)

Today, we’re excited to be rolling out a change to how Cloudflare works for customers. In the past, we distributed a CNAME record (app.bubble.io) that users had to ALIAS or CNAME to from their registrar. Many registrars don’t support ALIAS records, and that made using custom domains difficult.

Today, we’re launching a new version of the Cloudflare feature that uses A records. When you register a new custom domain, you’ll be given two records of the form 104.19.241.93 that can be entered directly as A records at your registrar, without changing your nameservers or your custom domain.


FAQs:

Q. My custom domain is pointed to app.bubble.io. Do I have to change my records?

A. No, app.bubble.io will continue to work for the indefinite future.

Q. There are two different A records. Do I have to use both?

A. No, one or the other, or both, should work identically. We provide two records for the sake of reliability: in the unlikely event that a particular address is unavailable, your customers’ browsers would be able to fall back to the second record.

Q. What happens when the IP addresses change?

A. We will advise you that your IP addresses should be changed in the Settings → Domain tab. Your custom domain will continue to function indefinitely, but no new signups will be allowed on the old IP addresses.

Q. Why did it take until now to get this feature?

A. This is a new feature for both Cloudflare and Bubble. When we told Cloudflare about our customers’ difficulties with the CNAME setup, they told us about this feature (which was still in beta at the time). We have been working with them since December to make this the best feature we can.


Caveats:

  • If you are using Cloudflare for DNS and you get 1014 errors on your custom domain, go into your DNS settings and set your custom domain to DNS only (“grey cloud”)

  • If you change your DNS records from app.bubble.io to our IPs and you get a 1000 error, go into your Bubble app, delete your custom domain, and re-create it exactly as it was. Within a few minutes the 1000 errors should clear up.

27 Likes

What steps can I take to enable the Cloudflare enhancements on my custom domain without taking any downtime to swap records? We’re using a custom domain, pointing at the IPs given during that set up, but the “Accelerate this domain with Cloudflare” is unchecked.

If I check that box, will that require downtime? What do I need to do after that? Can I roll it out over dev before live?

2 Likes

If you check that box, we generate a record on Cloudflare linking your custom domain to our account. They need to validate ownership of that record prior to issuing a certificate, which we try to do automatically before you’ve even changed your DNS records. There is no danger of downtime at this step.

Once you’ve checked the box, wait a few minutes for the certificates to be issued, then validate as follows:

Check to see if cloudflare knows about your website using this curl command

$ curl --resolve (your domain here):443:104.19.240.93 -I https://(your domain here)

What this is doing is sending a request, via HTTPS, to 104.19.240.93, but as if it was your custom domain. (The -I means, print the headers only.)

For instance, using a real domain:

$ curl --resolve myapp2.mywebpage.us:443:104.19.240.93 -I https://myapp2.mywebpage.us
HTTP/1.1 200 OK
[...]
Server: cloudflare
CF-RAY: 580e4945cb0ac5c8-EWR

Note two things:

  • The response has a status of 200, indicating success
  • The Server: header indicates the request is being handled by Cloudflare.

If this request succeeds, it’s safe to switch your A records at any time; you will not experience any downtime.

3 Likes

@peterj, you just made my day! :raised_hands:

I’ve been doing this for a few hours now and am not getting the Server/CF-RAY addition when using on my subdomain. Am I meant to have deployed or updated by DNS settings yet? I was trying to do as you mentioned here to avoid any downtime.

So the benefit to Bubble users is ease of setup?

Does this change anything with regard to your recommendation against using a bare domain?

Thanks, you helped me track down a bug I’d been looking for. A couple notes:

  1. I’ve updated the example command to reflect more accurately what needs to be tested to pre-validate your hostname.
  2. Right now, your custom domain is yielding a 409 error. I think I know what causes this, but to test it I had to create a new test domain on a slower registrar. Each cycle of create-test-fix takes about an hour, but I’ll have a more firm answer for what you should do before the end of the day.
  3. I’ll update the previous posts as I get more information.
2 Likes

@GQLA310
Subdomains were always easier, since they support CNAMEs out of the box. But now, we will give customers A records when they first configure their custom (sub-)domain.

@sudsy
Yes; this is a pure win from a Customer Success standpoint. It drops the barrier to creating a custom domain back to what it was in September, while retaining the advantages of Cloudflare, and frees up our Customer Success team to respond to more important issues.


To answer the implied question here: as of today, Bubble no longer has a strong opinion about what your custom domain looks like. If you want a bare domain, you can use a bare domain; if you want to use www, you can; if you want to use a subdomain, you can do that, too.

All registrars support A records, and we have smoothed out our code for managing custom domains as a result of the work of the past few months, so there is truly no difference now.

I’m going to set aside some time to update the manual to remove some of the guidance on this subject.

(That said, there are still some caveats to watch out for if you change your app’s custom domain.)

1 Like

Excellent. Thanks much!

1 Like

Perfect, thanks! I can now see Cloudflare (but also the enjoyable 409 which I’ll look forward to any advice on!) This is great, I was actually going to try out an Alias this weekend so perfectly timed!

… so, my DNS entry rolled over silently (it was on a ~4 hour TTL), and by the time I got to my test site, it “just worked”.

I don’t know if that counts as zero downtime, though. I do know that once your DNS entries rollover, Cloudflare will go from a 409 to a 200 (ok) pretty quickly.

Great, we are up and running! I just took the plunge during the 409 error and updated my DNS. We were down a few seconds but quickly resolved. Thanks so much!

1 Like

Glad to see the A record implementation. I have one question:

Does this open the door finally for the CNAME SAAS integration where users can CNAME our App domain?

1 Like

This is so awesome :grin:

I’m getting this error, not sure if anyone can help. This only occurs when URL includes www

“Error 1001” is the web version of a HTTP/409. It means that Cloudflare has yet to validate that your A records are pointing at the correct endpoint. It should clear up in a few minutes, once they check again.

See the backoff schedule here for an example of what validation delays to expect:

@vascolucci I can always count on you to keep me humble :wink:

The short answer is, no, it doesn’t by itself open the door.

I’ve been thinking about this question for the past year, and every time I come off a part of the code that relies on an app’s domain, I think “how much more complex would this be if apps could have more than one domain?” I’ve been making changes to our networking stack in a way that will allow us to get there, but there’s still work to be done.

3 Likes

Thanks for clearing that @peterj

I don’t want to hijack this post with the CNAME feature, but I think Cloudflare have fully featured SAAS services, since now bubble uses cloudflare this maybe a shortcut, or some kind of a partnership with Clearalias.com will pave the way and help us to make this happen.
I’m just suggesting ideas.

Thanks @peterj

@peterj great feature upgrade making it a lot easier than before.

When I add a custom domain I get presented this, I would have expected different IP’s?

Following this request intently.