Reputation: 5326
If AWS ELB does not have a static IP, doesn't that mean that if the IP changes before the client's DNS record expires, the client won't be able to access the resources pointed to by the ELB?
Or does it actually reserve the old IP for up to 24 hr (max DNS TTL) so that this will never happen?
EDIT: for clarification:
DNS records are cached on the client side. Eg. when client first query *.elb.amazonaws.com
, it returns 12.34.56.78
. For subsequent queries to *.elb.amazonaws.com
, it'd just use 12.34.56.78
instead of doing another DNS lookup (unless the DNS record expires, as dictated by TTL).
So if the internal IP of the ELB changes but the DNS record is still pointing to the old one, it'd not be able to access the resource?
Upvotes: 1
Views: 510
Reputation: 5326
Credits to Dusan's link: the user-controlled authoritative name server can only specify the TTL (which can be up to years) for the CNAME
record api.example.com
to *.elb.amazon.com
, which doesn't change.
The resolving of *.elb.amazon.com
into the actual IP 12.34.56.78
is done by Amazon's name servers, which has a TTL of 60 seconds.
Hence Amazon would only have to reserve the old IP for 60 seconds to ensure that all cached ELB IP records are valid.
Upvotes: 1
Reputation: 19758
AWS ELB offers a DNS name instead of an IP address because there are more than one ELBs running behind the scene managed by AWS internally for High Availability and Fault Tolerance.
If there is a change of internal servers, AWS will make sure the internal DNS mapping happen instantaneously.
When you want to map a custom domain name to a Elastic Load Balancer, that is why you need to use a CNAME instead of the IP address because of these internal complexities.
Upvotes: 0
Reputation: 1043
The Elastic Load Balancer service is designed to automatically detect and recover from failures of any component of the Elastic Load Balancer itself (part of that recovery can require replacing the load balancer and utilizing a new IP address)
Therefore its recommended to assign your DNS using using CNAMEs, if your DNS provider does not support CNAMES you could look into Route 53.
CNAME stands for Canonical Name. CNAME records can be used to alias one name to another. Elastic Load Balancer do expose the DNS name, AWS will do the internal IP address updating of ELBs etc.
Upvotes: 0