Re:How To: Hosting with Amazon S3, CloudFront and Route 53
by timdorr on Monday January 13, 2014 @02:23PM
(#7052700)
CloudFront has different IPs for different regions and manages this via DNS. So, if you're on an ISP peered directly with CloudFront and make a request using your ISPs DNS servers, CloudFront's DNS might give you back the IP to a server directly on that peering circuit. These kinds of relationships and new servers are added/removed all the time, so the IPs change regularly. A hard-coded IP in an A record won't work because of this. It works for your DO VPS because the IP is static and there is only one server.
[ Parent
| on HN ]
Re:How To: Hosting with Amazon S3, CloudFront and Route 53
by timrivera on Monday January 13, 2014 @03:08PM
(#7052950)
there's also the IP Anycast [1] option. That's what you get with OVH CDN [2], for example, but not with CloudFront. Anycast routing is totally independent from DNS, thus it works fine with an A record and also makes it easy to install SSL certificates.
Re:How To: Hosting with Amazon S3, CloudFront and Route 53
by hhw on Tuesday January 14, 2014 @03:16AM
(#7055972)
Anycast just refers to BGP announcing an IP address/range out of multiple locations. Most commonly, it's done with DNS because UDP is connectionless. It's becoming increasingly acceptable to do full anycast, i.e. have actual TCP/HTTP(S) on an anycast IP, but there are risks to that approach. If routing changes and you end up changing to a different location during a TCP session, the new location won't have all the state information needed, thus dropping the connection. It's theoretically possible to keep such state information synchronized, but it's sufficiently complex that nobody is doing so. This is why most of the larger, more established CDN's anycast DNS only and don't do full anycast.
Re:How To: Hosting with Amazon S3, CloudFront and Route 53
by eli on Monday January 13, 2014 @05:09PM
(#7053845)
Correct, though actually isn't CloudFront just a CNAME that could work with any provider?
One reason you might want something more advanced like Route 53 is if you wanted to point the "naked" domain (example.com vs www.example.com) to CloudFront. You can't just use a CNAME on an apex record, you need to use something like Route 53's "Alias" records.