3

I've set up an S3 bucket to host my static site.

Now I am trying to wrap CloudFlare around this, but I get the following warning when adding a CNAME entry for the root domain in CloudFlare's DNS manager:

CNAME  example.com  example.com.s3-website-us-east-1.amazonaws.com

Root domain CNAME records are not allowed by the DNS specification. Older recursors and mail programs may not follow this CNAME. You may want to change this record to an A record if you plan to use it as a MX or SRV target.

The examples I've found show a working setup using a subdomain (i.e. images.example.com per https://support.cloudflare.com/entries/22077268-How-do-I-use-CloudFlare-with-Amazon-s-S3-Service-) but I am interested in hosting the site entirely from the root domain.

Everything appears to work right now... The domain is setup with Google Apps MX records - can I ignore the warning from CloudFlare? I would feel more comfortable being able to set the root domain as an A record, but I'm not sure how to achieve this.

2 Answers 2

4

When your email stops coming in tomorrow, you'll know that it wasn't safe to ignore this warning.

The CNAME replaces all other resource records, so it overrides the SOA record, MX records and any other records you might have defined for the zone. That's why it's strongly recommended against. (And why providers recommend you not use the naked domain in preference to www.)

If you're on Route 53, they have a workaround to make this "work" (though it's ugly and nasty behind the scenes). It sounds like CloudFlare has the same sort of workaround in place. It's probably equally nasty, but you should be able to do it.

5
  • Thanks for the reply. So in this scenario, how can I get CloudFlare to wrap around my S3 static site without losing email functionality?
    – Harper
    Jun 3, 2013 at 2:47
  • Your zone apex will have to have an A record pointing to some actual host. Normally this would be something with a web server that does a 301 redirect to www.example.com. I've heard there are free services that offer this 301 redirect for you. Jun 3, 2013 at 2:51
  • I see. The reason I set it up like this to begin with is because CloudFlare seems to suggest it's okay: blog.cloudflare.com/…. I'm trying to avoid having to keep a webserver up (or relying on third-parties). Do you know by chance if Amazon Route 53 can provide a static IP/redirect to a bucket?
    – Harper
    Jun 3, 2013 at 4:16
  • Yes, if you're on Route 53, they have a workaround to make this "work" (though it's ugly and nasty behind the scenes). It sounds like CloudFlare has the same sort of workaround in place. It's probably equally nasty, but you should be able to do it. Jun 3, 2013 at 4:18
  • Using mxtoolbox.com to scan my DNS yielded the correct MX records. I'm guessing CloudFlare does something clever to expose them as-is? Either way, thanks for your help. If email breaks tomorrow I will configure an A record and subdomain/redirect.
    – Harper
    Jun 3, 2013 at 7:20
6

It should work properly now considering that CloudFlare has now enabled CNAME flattening.

You can see more here: http://blog.cloudflare.com/introducing-cname-flattening-rfc-compliant-cnames-at-a-domains-root

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .