Cloudfront CNAME vs DNS CNAME

荒凉一梦 提交于 2019-12-18 11:45:46

问题


I've set up a distribution but I'm a bit confused about the purpose of the CNAME that can be set up in Cloudfront. Assuming my assigned Cloudfront domain is d27fwrff25jcfdafa.cloudfront.net I can assign the "nice" CNAME static.example.com using the AWS Management Console.

I don't understand why I'd want to do this though. Why wouldn't I just create the CNAME in my sites DNS records and point it directly at d27fwrff25jcfdafa.cloudfront.net instead of creating the CNAME in Cloudfront? This is what I've done and it works perfectly but I don't like not understanding stuff.

Alternatively if I only created the CNAME using the Management Console wouldn't I then need to set my nameservers to Amazons so the CNAME can be resolved correctly? I can't find any mention of that step in the documentation so I guess I must be missing something!

Thanks for any help, Paul.


回答1:


The process you describe in your second paragraph is exactly right. You create the CNAME record in your domain using your DNS provider. You then tell CloudFront about the CNAME so it knows to use your distribution when requests come in with your CNAME in the HTTP Host header.

Hope this helps!



来源:https://stackoverflow.com/questions/4445396/cloudfront-cname-vs-dns-cname

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!