问题原文
原帖链接 · FLUSHER · CC BY-SA 4.0
What is a better approach for a webserver using EC2: to use its public DNS hostname as a CNAME record, or to attach an Elastic IP to it and use it with an A record? I suppose using the (elastic ip) A record is faster, but I seen a youtube tutorial where it's recommended to avoid using it, and to stick to public DNS hostname or to ELB. Is there any truth to that? If so, why?
已采纳解答
原帖链接 · Tim · CC BY-SA 4.0
I've been doing AWS for many years, got many of the qualifications, I've never seen a recommendation to use CNAME to the default public DNS. If you stop and start your server that domain name will likely change, which would need a DNS update and your site may appear to be down for some time due to DNS caching. There are probably other reasons it's a bad idea as well, mostly around lack of flexibility, but none come to mind right now.
I would always use an elastic IP and an A record for a single server, or Alias record to a load balancer in front of the EC2 server(s). The cost is zero or close to it and it gives you a flexible setup that I strongly most servers use.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
