The blog is under scheduled maintenance until Friday, 30 August 2024. For any issues, email [email protected].

Subscribe to receive notifications of new posts:

Zone Apex / Naked Domain / Root Domain CNAME Support for Amazon EC2, Google App Engine and Other Cloud Hosts

2011-05-16

1 min read

CloudFlare now supports CNAME Flattening, which is a better solution to this same problem. Read more in our knowledge base about RFC-compliant support for CNAME at the root.

One of the challenges of using a service like Amazon Web Services (AWS) Elastic Cloud (EC2) is you need to point your DNS to a CNAME. The problem is the DNS RFC (RFC1033) requires the "zone apex" (sometimes called the "root domain" or "naked domain") to be an "A Record," not a CNAME. This means that with most DNS providers you can setup a subdomain CNAME to point to EC2, but you cannot setup your root domain as a CNAMEto point to EC2.

In other words, you can do this:www.yourdomain.com CNAME some-id.ec2.amazonaws.com<

But, with most DNS providers (including Amazon's own Route 53), you can't do this:yourdomain.com CNAME some-id.ec2.amazonaws.com

You also cannot reliably point your root A Record to an IP address within the EC2 network since Amazon reserves the right to reallocate the IP address dedicated to your instance. While there are some hacks to redirect the root domain to a subdomain like "www", this limitation creates a mess many people wanting to use cloud service providers (">as evidenced by several threads on the subject).

Never one to let a RFC stand in the way of a solution to a real problem, we're happy to announce that CloudFlare allows you to set your zone apex to a CNAME. This allows CloudFlare users to host on EC2, Rackspace's Cloud, Google App Engine, or other cloud hosts and use their naked domain (e.g., yourdomain.com) without forcing a hack solution to a subdomain (e.g., www.yourdomain.com). Pick whatever host makes the most sense for you, sign up for CloudFlare, and we'll help ensure your site is as fast, secure, and effective as possible.

And, by the way, using CloudFlare's free service for a website hosted on EC2 typically makes the site about 50% faster worldwide while saving you about 65% off your bandwidth bill! Enjoy.

Cloudflare's connectivity cloud protects entire corporate networks, helps customers build Internet-scale applications efficiently, accelerates any website or Internet application, wards off DDoS attacks, keeps hackers at bay, and can help you on your journey to Zero Trust.

Visit 1.1.1.1 from any device to get started with our free app that makes your Internet faster and safer.

To learn more about our mission to help build a better Internet, start here. If you're looking for a new career direction, check out our open positions.
AWSEC2Reliability

Follow on X

Matthew Prince|@eastdakota
Cloudflare|@cloudflare

Related posts

March 06, 2024 2:01 PM

Magic Cloud Networking simplifies security, connectivity, and management of public clouds

Introducing Magic Cloud Networking, a new set of capabilities to visualize and automate cloud networks to give our customers secure, easy, and seamless connection to public cloud environments...

June 23, 2023 1:00 PM

How we scaled and protected Eurovision 2023 voting with Pages and Turnstile

More than 162 million fans tuned in to the 2023 Eurovision Song Contest, the first year that non-participating countries could also vote. Cloudflare helped scale and protect the voting application based.io, built by once.net using our rapid DNS infrastructure, CDN, Cloudflare Pages and Turnstile...