25 January 2012

Assigning your GoDaddy domain name to your Amazon S3 bucket

In the previous post we setup a static website using Amazon Web Services (AWS) S3 bucket storage. Now we’re going to assign the fancy new godaddy domain we just bought to that bucket.
You will need:
    - A GoDaddy Domain
    - An working S3 bucket hosting your website

1. Bucket Name
First and foremost in the last post we named our bucket whatever we want. In this post it’s crucially important we are very careful with what we name our bucket. Amazon gets the bucket name to use from the URL, so you’ll need to match your domain with your bucket name. For example if my domain was www.mygreatwebsite.com you would need to make sure your bucket was called www.mygreatwebsite.com So if you haven’t already done that, go ahead and create a new bucket. You can easily copy and paste your files across from your old bucket. Of course make sure it’s setup as a website all works with the S3 URL.

2. GoDaddy Domain Manager
First we need to open what GoDaddy call the zone manager, there may be better ways to find it but here’s how i get there. Open godaddy.com, hover the mouse over Domains and click “Domain Manager” and login. Hover over Tools and click “DNS Manager”. In the list of your domains click “Edit Zone” next to your domain. You’ll see a bunch of information here, but in short you’re looking under the CNAME heading for www. By default it’s value is @. You need to remove this at symbol and change it to: mygreatwebsite.com.s3-website-eu-west-1.amazonaws.com
Obviously replacing the url with the one for your S3 bucket. Especially the “eu-west” bit and the mygreatwebsite.com with yourgreatwebsite.com and save. This is where the name of your bucket we mentioned in step one becomes so important.

You may want to check you don’t have forwarding turned on. The first time I set this up I just used domain forwarding, which is a neat and easy to use feature, but it just creates an iframe for your site, which won’t help your SEO one little bit. That said, it is a very quick and simple to use feature of GoDaddys. You can turn domain forwarding on and off in the DSN manager using the forward button at the top.

If you own http://mysite.com and http://www.mysite.com then (I believe) you have to either setup two buckets one called mysite.com and one called www.mysite.com or of course you could forward one domain to the other.

That’s it, sit back and be patient, domain changes can take a few hours to process so go buy some donuts and cross your fingers. Hopefully that all worked like a dream.

I owe a lot to this guy, Aaron Blohowiak and his excellent blog entry: http://aaronblohowiak.com/using-amazon-s3-and-cloudfront-to-host-a-stat

and also this this one by Steve Liles:
http://steveliles.github.com/pointing_a_domain_name_to_an_amazon_s3_bucket.html

5 comments:

dan.easterman said...

Hi there, I followed your exact steps outlined here, but it is still not working for me. I just keep getting the "parked" godaddy page when I type in the url.
My bucket is called: dronejournalism.co.uk.
It is not a www but did I need to name the bucket http://dronejournalism.co.uk?
Perhaps I need to change to some additional settings in the godaddy "zone file"?

James Solo said...

Hi Dan,

I hope you've managed to sort the problem. A few key things to double check:

- Yes for these purposes www and non www sites are different. So your bucket names need to reflect that. You can always use a godaddy or aws re-direct though.
- Trying waiting a bit, sometimes DNS changes can take 24 hours to settle
- Ensure your aws zone is correct, in my example I used eu-west but aws have many different zones.
- Ensure the website works on your S3 URL, if so copy this URL (minus the http) to your godaddy zone file.

Best of luck, if you're still having problems drop me an email.

Vasanth said...

Hi, This works perfect for me. Thanks a lot.

Mark Paul said...
This comment has been removed by the author.
Mark Paul said...

Thanks for this, I've blogged about this previously as well. Specifically how to host your websites in AWS and they point your GoDaddy domain to your S3 bucket. Its detailed and has a step by step walkthrough with screenshots.

Read it here:
http://www.frontendjunkie.com/2015/04/save-money-by-moving-your-static.html