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

Why does AWS use host names for their load balancers instead of IP addresses?

· 52CE 我爱测

I'm getting to know how load balancers work in cloud platforms. I'm specifically talking about load balancers you use to expose multiple backends to the public internet here, not internal load balancers. I started with GCP, where…

问题原文

原帖链接 · Matt Welke · CC BY-SA 4.0

I'm getting to know how load balancers work in cloud platforms. I'm specifically talking about load balancers you use to expose multiple backends to the public internet here, not internal load balancers.

I started with GCP, where when you provision a load balancer, you get a single public IP address. Then I learned about AWS, where when you provision a load balancer (or at least, the Elastic Load Balancer), you get a host name (like my-loadbalancer-1234567890.us-west-2.elb.amazonaws.com).

With the single IP, I can set up any DNS records I like. This means I can keep my name servers outside of the cloud platform to set up domains, and I can do DNS challenges for Lets Encrypt because I can set a TXT record for my domain after setting an A record for it. With the host name approach, I have to use ALIAS records (AWS has to track things internally) so I have to use their DNS service (Route 53). This DNS difference is a slight inconvenience for me, because it's not what I'm used to, and if I want to keep my main name servers for my domain outside of AWS, I can. I would just delegate a subdomain of my domain to Route 53's name servers.

So far, this DNS difference is the only consequence of this load balancer architectural difference that I've noticed. Maybe there are more. Is there a reason GCP and AWS may have chosen the approaches they did, from an architecture perspective? Pros and cons?

已采纳解答

原帖链接 · MLu · CC BY-SA 4.0

In AWS the Load Balancer IPs may change and the change is automatically reflected in the DNS name. Hence you refer to the DNS name (e.g. as a CNAME) and it all works. When using Route53 for DNS you can even create ALIAS-A records which directly propagates the current IP addresses from the LB DNS to your custom DNS name.

If you want the same behaviour as in GCP, i.e. a Load Balancer with two fixed, non-changing IP addresses look up Amazon Global Accelerator. It seamlessly integrates with AWS Application Load Balancer and gives you the same experience as you're used to on GCP.

Hope that helps :)

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

资料来源与适用范围

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

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

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