amazon-s3cname

How do you set up a cname for an S3 bucket using Amazon Route 53?


I am making a personal site for myself and I've decided to host it on Amazon S3. I'm also trying to use Amazon Route 53 for the nameserver, but I'm having some trouble getting it to work. I'm trying to set up a CNAME that points my domain name (bret-truchan.com) to the bucket.

My bucket name is bret-truchan.com. It is configured as a website and browsing to the endpoint works just fine: http://bret-truchan.com.s3-website-us-east-1.amazonaws.com/

I have added the four Amazon name servers to my DNS through my DNS provider's console.

Here's my bucket setup:

My Amazon Bucket Setup

Here are my Amazon Route 53 record sets:

My Amazon Route 53 record sets

Here are the details of my CNAME. Notice that the CNAME's Name is set to *.bret-truchan.com. I guessed at this. I'm also not sure if the value of the CNAME is correct. I've read some examples where the CNAME value ends in a period, but mind does not.

enter image description here

Here's a ping test:

ping test


Solution

  • I don't think ping is a useful test -- ICMP packets are often dropped on the floor these days -- it isn't the reliable diagnostic that it once was. Sure, if it responds, you've got that -- but if you get a timeout, the most likely answer is a firewall (perhaps Amazon's group policies) DROPs the packet on the floor.

    Incidentally:

    $ host bret-truchan.com
    $ host www.bret-truchan.com
    www.bret-truchan.com is an alias for bret-truchan.com.s3-website-us-east-1.amazonaws.com.
    bret-truchan.com.s3-website-us-east-1.amazonaws.com is an alias for s3-website-us-east-1.amazonaws.com.
    s3-website-us-east-1.amazonaws.com has address 207.171.163.1
    $ HEAD www.bret-truchan.com
    404 Not Found
    Date: Sat, 19 Nov 2011 02:35:15 GMT
    Server: AmazonS3
    Client-Date: Sat, 19 Nov 2011 02:35:15 GMT
    Client-Peer: 207.171.163.213:80
    Client-Response-Num: 1
    Client-Transfer-Encoding: chunked
    X-Amz-Error-Code: NoSuchBucket
    X-Amz-Error-Detail-BucketName: www.bret-truchan.com
    X-Amz-Error-Message: The specified bucket does not exist
    X-Amz-Id-2: MKHMddVEYia5cV0iU33QLg7vt6FgM69jyu+jKjTsh1aVuUR8seGwQQT2sfZrSlu9
    X-Amz-Request-Id: 6681133093178B5F
    

    If anything, it looks like the hostname www.bret-truchan.com is being used for the bucket -- and you said the bucket was named bret-truchan.com instead. That is probably the reason for the 404 response.

    But the dropped ping packets are probably due to Amazon's firewalling.