0
votes

I am moving several sites to S3 to host them as static sites and have moved DNS here as well. I followed the AWS guide step by step, but continually get an error on the CNAME setup for WWW. Here is my setup:

  1. Created bucket jeremyandlauren.com and set up static hosting and permissions.
  2. Endpoint is now jeremyandlauren.com.s3-website-us-west-2.amazonaws.com and this works fine.
  3. Pointed nameservers for this domain to Route 53.
  4. Created an A record pointing to the Alias Target jeremyandlauren.com.s3-website-us-west-2.amazonaws.com.
  5. Created a CNAME pointing www to jeremyandlauren.com.s3-website-us-west-2.amazonaws.com.

Now when you hit the URL either with or without www you get:

Code: NoSuchBucket 
Message: The specified bucket does not exist 
BucketName: www.jeremyandlauren.com

Does anyone have any ideas how to fix this? I have tried a couple options for the CNAME, but nothing seems to take.

Thanks in advance.

2

2 Answers

1
votes

It looks like jeremyandlauren.com works, however, www.jeremyandlauren.com does not work. The reason you are probably running into this is that your DNS name needs to match your bucket name. You probably do not have a bucket with the name of www.jeremyandlauren.com. There are two way easy ways to fix this.

  1. Create a bucket www.jeremyandlauren.com and redirect it to jeremyandlauren.com. (More info here: http://aws.amazon.com/about-aws/whats-new/2012/10/04/web-page-redirects-on-amazon-s3-hosted-websites/)
  2. Create a CloudFront distribution with the origin of jeremyandlauren.com.s3-website-us-west-2.amazonaws.com. Add www.jeremyandlauren.com & jeremyandlauren.com as a CNAME. Update DNS for www.jeremyandlauren.com & jeremyandlauren.com to be an A type alias to your CloudFront Distribution.
  3. Keep both www.jeremyandlauren.com & jeremyandlauren.com buckets in sync with the same data.
0
votes

Its working fine for me - both with and without the 'www' if its not working for you, it may be because your dns is cached locally, or the propagation has just not made it to your servers yet - give it time.

If you are using chrome you can try clearing your local dns cache:

Navigate to chrome://net-internals/#dns and press the "Clear host cache" button.