Configuring Route 53 DNS in AWS: Public DNS & Private DNS

Amazon Web Services (AWS) provides a powerful and flexible Domain Name System (DNS) service called Amazon Route 53. Route 53 allows you to manage public and private DNS records, making it an essential component for hosting your applications and services in the cloud. In this article, we’ll go through the process of configuring Route 53 DNS for both public and private scenarios, with detailed steps and explanations along the way.

Public DNS Configuration

Public DNS is an essential component of any web-based application or service that needs to be accessible over the Internet. It translates human-readable domain names (e.g., www.example.com) into IP addresses that computers understand. When a user enters a domain name in a web browser, the DNS system resolves the domain name to the corresponding IP address, which allows the browser to establish a connection with the appropriate server.

Step 1: Creating Route 53 in AWS

Sign in to the AWS Console.

Search “Route 53” in the search box.

Accessing Route 53

You will see the dashboard for the Route 53 service.

Click the “Create Hosted Zone” button in the Route 53 dashboard.

Creating the public hosted zone in Route 53

Enter your domain name (e.g., example.com) in the “Domain Name” field.

Select the type “Public hosted zone.”

Click on “Create hosted zone.”

Adding domain name in hosted zone record

The hosted zone is created successfully.

The hosted zone was created successfully. 

(Route 53 will provide you with four nameservers. These nameservers need to be updated in the DNS settings of your domain registrar to delegate DNS management to Route 53.)

Copy the nameserver. (We need to update these nameservers in the domain registrar site.)

Step 2: Configuring Domain Registrar with Amazon Route 53 Nameservers

Go to your domain registrar’s website. (e.g. godaddy.com, porkbun.com, etc…)

Go to the “Authorized Namerver” or “Nameserver” section in your registrar website and paste those DNS values there.

Adding AWS Route 53 nameserver in the registrar

It can take up to 48 hours to change your nameserver. You can check your nameserver status from dnschecker.org. (In most cases it gets updated after a few hours.)

Checking the nameserver record 

After your nameserver has been updated, go back to the AWS Route 53.

Click on “Create Record.”

Creating a record for our domain name 

Step 3: Associating an EC2 IP Address with a DNS Record in AWS Route 53

Now, leave the “Record name” blank, “Record type” as A, and add the instance IP address in “Value.”

Adding the different values based on the requirement

(Note: You can click on Info on the side of different options and values to know more about it.)

You can create various types of DNS records within your hosted zone. These records define how your domain name maps to different resources, such as IP addresses or other domains.

AWS offers a range of routing policies in its Route 53 service to cater to diverse application needs. These policies include Simple routing, which directs traffic to a single resource; Weighted routing, enabling load balancing based on assigned weights; Latency-Based routing for optimizing user experience by directing traffic to the lowest-latency resource; Geolocation routing, which considers the geographic location of users for localized content delivery; and more.

Time to Live (TTL) is the duration for which DNS resolvers cache the DNS records.

Lower TTL values are suitable for rapidly changing resources but might lead to increased DNS query load.

Now click on “Create records”. It will create the record. You can click on the “View Status” button at the top right to see the status. Wait for the status to be changed to “INSYC.”

Checking the status of our newly created record

You can now access the EC2 instance from your domain name.

Accessing the AWS EC2 instance from the domain name 

Step 4: Associating a Load Balancer with a DNS Record in AWS Route 53

Click on “Create Record.”

Created a record for an Application Load Balancer

Now, leave the “Record name” blank. (As we will be adding a root domain record.)

“Record type” as A.

Enable “Alias”. (If you want to route traffic from the root domain to an AWS resource like an Application Load Balancer or CloudFront distribution, you should use an alias record.)

Select the endpoint as “Alias to Application and Classic Load Balancer.”

Choose the region in which your AWS ALB is located.

Select the ALB from that region.

Leave routing policy as default and you can also evaluate target health (optional).