How to connect a domain name to an EC2 instance

 Launch an EC2 instance and set up the web server (In my case, I setup the Ubuntu12.04 instance and install the Apache web server on it):

At this point my website is up and running but with the long amazon url(i.e.

Each EC2 server is assigned a dynamic IP. If a server has to be restarted, it is given a new dynamic IP and we have to remember this new long string each time to access our web server.

To overcome this problem, we can create free domain with and map it with our web server. For this, allocate an Elastic IP and associate it with the instance.

Then right click on the Elastic IP and select the “Associate“, and choose the instance that we created above:

Now we have an elastic IP which is a number that looks like Copy this number because we will use it in next step:

Login to the site and navigate to this panel:

Add the elastic IP against the “A Record” entries:

Finally, we need to wait sometime (few minutes to an hour) for it all to propagate through.After that our domain should now start resolving to the web server we have on EC2:

Hope this will help you!

Please Remember me in your prayers!

Enjoy :-)


One response to “How to connect a domain name to an EC2 instance

  1. Pingback: AWS - Articles - Khai's personal knowledge vault.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: