prabhat
prabhat

Reputation: 1

switching public dns between ec2 instances

Is there a way to switch/exchange the public dns i.e. the url through which we can publicly access the instance, between two ec2 instances(running) ?

Upvotes: 0

Views: 121

Answers (1)

Eight-Bit Guru
Eight-Bit Guru

Reputation: 9971

Yes, Elastic IP will let you do this. You can't alter the dynamically-assigned DNS name of an instance, except by stopping and restarting it - and even then, although the DNS name will change (because it's derived from the automatically-generated IP address) you have no control over what it'll change to.

However, if you allocate two EIP (Elastic IP) addresses and assign one to each of the two instances in question, you can then subsequently swap them over by de-assigning and re-assigning them. You can't choose what the DNS names will be (because they're derived from the EIP address, which is allocated from a pool) but you can be certain they won't change.

Upvotes: 1

Related Questions