DNS, CNAME, and Routing
BACK

DNS, CNAME, and Routing

Services used: Route 53, EC2, VPC

Languages used: N/A

Objective: Use Amazon Route 53 to map an IP address to a domain name, and create a CNAME record to point one domain to another. Configure local hosted zones to provide domain names internal to the VPC.

First, search for and open EC2.

Click Instances and ensure that the Internal News Server and Bastion Host are running. Select the Instance ID of Internal News Server.

Copy the private IPv4 address and save for later use. Go back to instances.

Select the check box for the Bastion Host instance and click Connect.

Connect to the Session Manager.

Ping with the copied ip address in the CLI. To attempt to ping the server using the DNS, run: ping thewhitepaper.internal.news.org

Next, search for and open Route 53.

Select Create hosted zone.

For Domain name, type internal.news.org and give it an appropriate description. Then for type, select Private hosted zone.

Select the N. Virginia region and the appropriate VPC. Then click Create hosted zone.

Click Create record.

Type thewhitepaper for name, select Record type “A”, paste the IP address copied earlier from Internal News Server to the value, while keeping default TTL and Routing policy. Click Create records.

Ensure the A record routes to the correct IP address.

Go back to the Session manager Connect CLI and try to ping using the same DNS as before. There is now a connection to the server using the DNS.

Return to the Hosted zones under Route 53. Next, we will create a CNAME record database.internal.news.org

Type database for name, select Record type “CNAME”, type the same DNS for value, while keeping default TTL and Routing policy. Click Create records.

Ensure the CNAME record routes to the correct DNS. Success!