Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

If I stop an Amazon EC2 instance and then start it again it will loose it's address. How do I prevent that?

share|improve this question

migrated from stackoverflow.com Mar 20 '11 at 7:16

This question came from our site for professional and enthusiast programmers.

add comment

2 Answers 2

up vote 3 down vote accepted

You cannot prevent that, the public DNS of any instance cannot be relied upon to be constant. Either:

  • Add a dynamic DNS service to the instance so that it updates a dynamic DNS address somewhere and you use that dyn DNS address, or:
  • Use an elastic IP. When you stop and start the instance, ensure the IP address is associated with that instance. Note that unmapped IP address cost when the instance is off. You need to add an A record to your DNS entry to map to that IP address. If the instance is off a lot, you'd better using route 53 DNS for the domain with a short TTL on your specific domain. That way you can remap the A record to your elastic IP fast.
share|improve this answer
    
Perfect! That's exactly what I want to know. Thanks :-) –  Anonymous Mar 18 '11 at 12:58
add comment

Depending on what you're trying to do, you might want to consider putting an elastic load balancer in front of an auto scaling group which contains your instance(s). Instances can come and go, but you only need to know the endpoint of your ELB. Note: ELB's are public. This is also the endpoint for your SSL certs.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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