Managing DNS Records with AWS Route 53

45 minutes
  • 3 Learning Objectives

About this Hands-on Lab

In this hands-on lab you will learn how to create and manage DNS records inside of Route 53. You’ll start by creating a simple application. It will serve as a test website from two EC2 instances, and will route traffic using an Application Load Balancer ELB. After this, you will create two records inside a Route 53 hosted zone that will configure the DNS settings for a custom domain and point it to your application. Further, you’ll look at how DNS works in this scenario (and in general) and how a command line utility like `dig` can get more information about a domain. These skills will allow you to associate many kinds of AWS web applications with recognizable web domains such as **.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create Two EC2 Instances
  1. Navigate to the EC2 portion of the console.
  2. Press Launch Instances .
  3. Pick an Amazon Linux AMI.
  4. Select the T2 Micro free tier eligible instance type .
  5. On the Configure Instance step make sure that the Linux Academy VPC is selected.
  6. Make sure to select a different subnet for each of the two instances.
  7. Make sure to change Auto-assign Public IP address to Enable.
  8. Add a User Data Script under the advanced details section (see the description of this activity for the code you need).
  9. Press Next a few times until you get to the Confiure Security Group step.
  10. Create two instances:
    • Create a new security group and add HTTP access to the security group.
    • Make sure to select the security group you just created for the previous instance.
  11. Press Next and press the button to launch the instance (you will have to create a keypair to do this step).
  12. Repeat these steps again, but make sure to note the differences between the first and second instance’s creation process here.
Create an Elastic Load Balancer

Create an Elastic Load Balancer in the AWS console:

  1. Navigate to the Load Balander section of the EC2 console.
  2. Press Create load balander.
  3. Select Application load balancer.
  4. Give the load balancer a name.
  5. Make sure to include the two Availability zones for this load balancer.
  6. Skip over the Configure Security Settings step.
  7. On the Configure Security Groups step create a new security group with the defaults.
  8. On the Configure Routing step make sure you select New target group and name your target group.
  9. Under Advanced health check settings set Healthy Threshold to 2.
  10. Wait a few minutes, then test out your new ELB from the DNS name provided under the ELB’s description in the EC2 console.
Create Route 53 Record Sets
  1. Navigate to the Route 53 portion of the console.
  2. Enter the hosted zone for the custom domain you are provided.
  3. Press the Create Record Set button and select the A – IPv4 Address type.
  4. Make sure Alias is selected as Yes.
  5. Find your Elastic Load Balancer domain in the dropdown, select that and then press Create down at the bottom of the page.
  6. Repeat this process except make sure to enter www in the Name for one of the two records, so that you have an A record for the www subdomain too.

Additional Resources

Make sure that when you eventually navigate to the Route 53 hosted zone the only DNS records you see are the NS and SOA records. If there are others there you can delete them.

User Data code snippet for this lab:

yum update -y
yum install -y httpd
cp /usr/share/httpd/noindex/index.html /var/www/html/index.html
service httpd start

PLEASE ENSURE YOU USE THIS SNIPPET otherwise the ELB healthchecks will fail.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?