Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Any help would be much appreciated! Thanks so much!

like image 937
clone45 Avatar asked Nov 19 '11 02:11

clone45


People also ask

What is CNAME in AWS Route 53?

CNAME records Route 53 responds to the first DNS query with the name of the record that you want to redirect to. Then the DNS resolver must submit another query for the record in the first response to get information about where to direct traffic, for example, the IP address of a web server.


1 Answers

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.

like image 182
sarnold Avatar answered Sep 30 '22 04:09

sarnold