Assign an Elastic IP Address to an EC2 Instance

I recently installed a new Ec2 instance and setup the system for a web service. At some point, I rebooted the instance and noticed that I could not connect to the web service via the Public IP address assigned to it. Upon investigation I discovered that the public DNS address had changed hence service not accessible.

To avoid this in future, Amazon has a built in feature to allow one to associate a static DNS IP address to an Instance so in the event of instance reboot, it does not get assigned a new DNS address but rather maintains the previously assigned address.


– When logged into your AWS account – click on EC2


– Under Network & Security – click Elastic IPs


– Click on ‘Allocate New Address’ (This is assuming you have no free IP address available)


– Select EC2 on the dialog box pop up – click ‘Yes, Allocate’


– You should be assigned a new standard EC2 IP address in the list


– Right-click on the new address and click ‘Associate Address’


– Care should be taken when selecting the new Instance so an existing instance IP isn’t changed – click ‘Associate’


That’s it. Note, do not reserve an IP if not needed as this will incur costs per hour

comments powered by Disqus