How To Connect A Domain Name to AWS (EC2) Instance

Route 53 Record Sets | Map a Registered Domain onto an Amazon Machine (ec2) Instance

Observable Value

You have registered a domain like and you want the browser url to serve the index.html page on the apache2 middleware web server.


  • you have registered a domain name with Amazon’s Route 53.
  • Route 53 sets up (1) hosted zone and two (2) record sets 4u.
  • you have launched an ec2 instance logged in via SSH (port 22)
  • you know the public IP address of your “just-created” instance
  • with sudo apt-get install apache2 you’ve installed a web server
  • you’ve added an inbound TCP rule through Port 80 from

Let’s say is the public IP address of your newly created instance. Does in your browswer get you the apache (or nginx) welcome page?


Our mission is to get resolving in the browser.

Two (2) Record Sets Are Done

In the AWS console go to the Services tab, then Network and Content Delivery, then Route 53 then Hosted Zones.

Check the “Record Set Count” against the domain. Two (2) hosted zones have been automatically created.

Now click on the domain name link. Can you see two (2) record sets?

  1. A NS record set with 4 Name Servers are done. Tick.
  2. A SOA Start Of Authority set has also been setup. Tick.

Don’t worry if you do not understand the above. Just make sure that they are there.

Add 2 Hosted Zone Record Sets (Console)

Let’s add two (2) record sets to map the newly registered domain to the instance IP address.

Click on Create Record Set. Do not touch the Type that defaults to an IPv4 address. Keep Alias as No. Leave the TTL (Time To Live) as 300 seconds. Keep the routing policy Simple.

  • Leave Name blank. Enter IP Address eg in the value field.
  • Click Create to create the first record set. Then click on Create Record Set again.
  • www. Enter the 4 characters (incl period) in “Name”.
  • Like before you enter the IP Address into the value field.
  • Click Create to create the second record set.

Well done. Now go to your browser. Type in and

Both URLs should now work. Well done.

Add 2 Hosted Zone Record Sets (AWS CLI)

Are you a DevOps guru practising continuous delivery? Do you automatically provision infrastructure resources?

If yes and yes, you can create the record sets using the AWS CLI (Command Line Interface). You can do it in Bash, Java, Python, Ruby, C# and even Powershell. Using BASH – here is the command to setup the two record sets.

Advanced – Creating a Url Sub-Domain

If you want to setup an auto-provisioned URL like

then you need to one more record set in order to append dev-environment.7064.1137 to your base url.

What Next – Configure HTTPS / SSL Web Traffic

Professional websites use HTTPS / SSL (encrypted) traffic for all communications. Google and Bing reward sites carrying HTTPS as the people behind the website are serious about protecting customer information.

Why not configure HTTPS for your site now. You can do it.

Leave a Reply

Your email address will not be published. Required fields are marked *