-1

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.

SundayMonday
  • 101
  • 4

1 Answers1

1

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 207.171.163.1

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.

mgorven
  • 30,615
  • 7
  • 79
  • 122
  • 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 03: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 05:07