I want to host my static site www.something.com on Amazon S3. I've followed these instructions however I'm still having trouble. Specifically when I browse to www.something.com I'm sent to whatever my previous host has for the site. I think the problem is related to "DNS CNAME alias" however today is the first time I've heard about CNAMES so I'd love some help.

Right now I've added a CNAME alias where "host" is "www" and "points to:" is "http://www.something.com.s3-website-us-east-1.amazonaws.com/". I've double checked my S3 bucket: it's named "www.something.com", the website feature is enabled and all files are public. Browsing to "http://www.something.com.s3-website-us-east-1.amazonaws.com/" works fine.

I'm trying to work with my DNS provider but they just send me to reference docs that I've already looked over. Perhaps the DNS entry is just taking a while to update. But I created the CNAME about 10 hours ago which I think is ample time. I've read around this site and the net and it seems like CNAMES sometimes can't be used for www but instead are for subdomains. I'm pretty new to this so any advice is appreciated.

closed as off topic by womble, Ward, Scott Pack, HopelessN00b, Shane Madden Aug 28 '12 at 5:27

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question.

  • You've never heard of CNAMEs before? How long have you been a sysadmin for? – womble Jul 29 '12 at 7:19
  • It's presence on this site for professional sysadmins. – womble Jul 31 '12 at 10:04
  • No, apparently you don't. – womble Jul 31 '12 at 20:57

Pointing www.example.com to S3 with a CNAME record should work fine (CNAMEs only can't be used at the apex of a zone, i.e. example.com). Note that you should only have a CNAME record for that name, so make sure you've removed any A records you used to have. Check that the name is resolving correctly with the host command like this:

$ host www.example.com
www.example.com is an alias for www.example.com.s3-website-us-east-1.amazonaws.com.
www.example.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

If it doesn't resolve similarly to above then either it's still cached, or your configuration is wrong. If it does resolve like this then either your browser or a proxy you're using is caching the website.

  • Awesome thanks! host www.something.com does resolve to what you have above. However visiting the site in my browser still goes to the old content. Funny you should mention A records because I just received an email from my DNS provider mentioning an A record that was just removed because it was overriding the CNAME. Anyways now apparently I need to wait for up to 12 hours for something to propagate. – SundayMonday Jul 29 '12 at 3:55
  • A zone with CNAME is not supposed to have other records. The maximum wait time depends on the TTL of the old provider. – Skaperen Jul 29 '12 at 5:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.