Maybe you've read about the Obama campaign's $250 million fundraising platform and wondered how they achieved such blazing performance. The secret? They used a CDN to serve static content lightning-fast to users worldwide.
I've been using Jekyll for years, but there was always one frustrating limitation that kept me from deploying to Amazon S3 and CloudFront for hosting.
Here's the thing: to use Amazon S3 or CloudFront for hosting, you need a CNAME record. That means you're stuck with addresses like blog.mydomain.com or www.mydomain.com.
For some people, this isn't a big deal. But if you're like me and prefer clean URLs without the "www" prefix, this was a dealbreaker. Your domain apex (the bare domain.com without any subdomain) simply couldn't point to CloudFront using traditional DNS records.
This is where ANAME records come in. Unlike standard DNS records, ANAME is a proprietary record type that lets you point your root domain directly to CloudFront distributions. No "www" required.
If you're serious about performance and want your site to load faster globally, 👉 DNS Made Easy offers ANAME records that solve the root domain challenge. For about $30 per year, you can manage up to 10 domains and finally ditch that outdated "www" prefix.
With ANAME configured on your domain apex, you can now serve your Jekyll site through CloudFront without compromising on your preferred URL structure. Let's walk through the migration process.
Create your bucket
Head to the S3 Management Console and create a new bucket. Here's the crucial part: name it exactly yourdomain.com (your actual domain name).
Configure the bucket policy
You'll need to set up a bucket policy that allows public read access. This tells S3 that anyone can view the files in your bucket, which is exactly what you want for a public website.
Enable static website hosting
In your bucket settings, enable static website hosting and set index.html as your index document. S3 will give you a website endpoint URL—save this, because you'll need it for CloudFront.
CloudFront is Amazon's CDN that caches your content across data centers worldwide. When someone visits your site, they get served from the nearest location, which drastically reduces load times.
Create a new distribution
When you create your distribution, you'll see a dropdown listing your S3 buckets. Don't select these. Instead, manually enter the website endpoint you saved earlier from S3 (it looks like yourdomain.com.s3-website-us-east-1.amazonaws.com).
This is important because using the website endpoint instead of the bucket name ensures proper handling of index documents and redirects.
Set your distribution settings
Add both domain.com and www.domain.com as alternate domain names (CNAMEs) in your distribution settings. Also specify index.html as your default root object.
After CloudFront creates your distribution, copy the distribution domain name (something like d20l41xryjmszl.cloudfront.net). You'll use this when configuring DNS.
Now comes the part where traditional DNS falls short and 👉 ANAME records from DNS Made Easy become essential.
Create your DNS Made Easy account and add your domain. Then create an ANAME record pointing to your CloudFront distribution domain (add a trailing dot, like d20l41xryjmszl.cloudfront.net.).
Set the TTL to 60 seconds initially—this gives you flexibility to roll back quickly if something goes wrong.
Before switching your domain registrar's nameservers, let's make sure your content is actually deployed to S3.
Install S3Cmd
The standard version of s3cmd doesn't support CloudFront cache invalidation for static sites. Fortunately, there's a fork that handles this perfectly.
Clone the modified version:
git clone https://github.com/joseprio/s3cmd.git
cd s3cmd
sudo python setup.py install
Configure your credentials
Run s3cmd --configure and follow the prompts to enter your AWS access key and secret key.
Create a publish script
Make a shell script called publish.sh with this command:
s3cmd sync --delete-removed --acl-public --reduced-redundancy --cf-invalidate _site/ s3://yourdomain.com/ --verbose
This command syncs your Jekyll build folder (usually _site), removes deleted files, makes everything public, uses reduced redundancy storage to save costs, and invalidates the CloudFront cache.
Deploy your site
Run sh publish.sh and watch your files upload to S3.
Visit your CloudFront distribution domain directly in your browser. If you see your site, everything is working correctly.
The final step is updating your domain registrar to use DNS Made Easy's nameservers. This switches your DNS from your old provider to DNS Made Easy, activating that ANAME record.
Within an hour (usually much faster), your Jekyll site will be live on your root domain, served through CloudFront's global CDN. You get blazing-fast load times, worldwide coverage, and a clean URL without "www". That's the trifecta of static site hosting.