- Each EC2 Instance will have a private and public IP.
- From private IP, Private DNS will be created and from public IP, public DNS will be created.
- When you stop and start the instance, the public DNS will be re-assigned.
Registering IP address:
- Go to Network & Security on EC2 dashboard, in the Elastic IP menu, click on allocate the new address to get the IP address registered with your account.
- You can also give the name to IP address.
Associating the IP address to the instance:
- To allocate registered IP address with an instance, Select the IP, click on Actions and then “Associate Address”.
- Select the instance to which IP address should be allocated and Click on “Associate”.
- Now, you are associated with rented Elastic IP to EC2 instance, You can stop and start EC2 Instance, the public DNS or IP will not be changed.