大网数据广告活动
服务器运维问答

AWS EC2 Elastic IP vs Public DNS Hostname?

· 52CE 我爱测

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 …

问题原文

原帖链接 · 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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-05-05)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。