How to use domain name instead of public DNS / IP in Amazon Linux EC2 instance ?

In this post, we will describe how you can use the domain name like http://www.lynxbee.com instead of Amazon public IPv4 address or public ipv4 DNS urls like ecx-x-x-x-0.us-east-2.compute.amazonaws.com …

1. Login to your AWS console.

2. From dashboard, left sidebar , goto “Network & Security” and click on “Elastic IPs”

3. click on “Allocate Elastic IP address” and you will see the window as,

4. click on “Allocate”, once you click on Allocate,you will see dashboard as below, where you will see an IP address allocated.

5. Now, we need to associate this IP address to our EC2 Instance as, select this Elastic IP, and from top right drop down, click on “Associate Elastic IP address”

From the next window, in “instance” search for the instance IP where you want the domain to be assigned and respctive private IP address and then click on “Associate”

once you click on “Associate” on the next page you will see a message as below,

here, note the ip address from column “Allocated IPv4 address” which we need to add in domain settings.

Now, login to your domain registrar , and update the A record as below, ( here in first column select “A Record” , in second column enter the domain name which you want to associate with AWS instance, in third column, enter the Elastic IP as received in AWS settings)

Leave a Comment