46

Does the ELB's IP Ever Change once setup, or will it always access instances from the same location during its lifetime no matter what might be going on with it behind the scenes at Amazon?

4 Answers 4

46

ELB's IP address keeps changing. You should instead use the DNS name provided to you.

http://developer.amazonwebservices.com/connect/thread.jspa?threadID=32280

3
  • 6
    And what would you recommend if these addresses need to be maintained in a Firewall? Commented Sep 26, 2017 at 22:45
  • @JamesBoutcher maybe you should use a VPN
    – Skullone
    Commented Mar 27, 2019 at 20:19
  • The DNS name only resolves to the external IPs (of a public load balancer) and not the internal IPs, even if you're in the same VPC and subnet
    – kbolino
    Commented Feb 28, 2024 at 0:05
17

The short answer: Yes, ELB's IP addresses (both the ones that are publicly distributed to clients of your service, and the internal IPs from which ELB sends traffic to your instances) dynamically change.

The long answer: See my article about how ELB works for more info: http://shlomoswidler.com/2009/07/elastic-in-elastic-load-balancing-elb/

2
  • Nice Article Shlomo but I'm making the forum thread my preferred answer on this one as it deals with many people's experiences directly.
    – CoderChris
    Commented Oct 1, 2010 at 9:45
  • Link is dead Shiomo, plz edit if it's still available anywhere Commented Aug 18, 2021 at 19:44
12

I understand this question has been already answered but I found the article "Best Practices in Evaluating Elastic Load Balancing" on the AWS site that explains why the ELB's IP addresses keep changing.

By default, Elastic Load Balancing will return multiple IP addresses when clients perform a DNS resolution, with the records being randomly ordered on each DNS resolution request.

...and the importance to ask to the DNS the actual IPs to use

If clients do not re-resolve the DNS at least once per minute, then the new resources Elastic Load Balancing adds to DNS will not be used by clients.

http://aws.amazon.com/articles/1636185810492479

3

Note: originally ELB (Elastic Load Balancer) referred to an L7 balancer what is now called ALB (Application Load Balancer), which indeed has changing IPs.

But there's an other kind of ELB, the L4 NLB (Network Load Balancer), which by default uses static IP addresses (and you can stick Elastic IP as well, if you want flexibility of moving the ElasticIP around).

So it is important to distinguish which ELB we are talking about - ALB or NLB.

1
  • 1
    At the time the question was originally asked there was only the "elastic load balancer" which is now the Layer 7 (L7) ALB you refer to. So the questions and answers pertain to that.
    – CoderChris
    Commented Sep 17, 2021 at 9:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.