Benjamin Hao
Benjamin Hao

Reputation: 338

Why do we need to create the DNS A record for API Gateway custom domain?

According to the tutorial, after we create a custom domain name for our API Gateway, we need to create a Route 53 DNS A record, which basically routes the traffic to the custom domain name to the target domain. I'm curious why AWS doesn't do it automatically and what happens under the hood when we create the custom domain name.

Upvotes: 2

Views: 1384

Answers (1)

Rodrigo Murillo
Rodrigo Murillo

Reputation: 13632

This section explains it well:

An alias record is a Route 53 extension to DNS. It's similar to a CNAME record, but you can create an alias record both for the root domain, such as example.com, and for subdomains, such as www.example.com. (You can create CNAME records only for subdomains.

First, the DNS record is a special resource record only supported by AWS route 53, and it supports both the root domain, and subdomains. Normal DNS uses CNAME records, which don't work at the root domain.

Secondly, as to why it's not automatically created for you, well I'm not sure. But its easy to do manually. Select the alias record type, and it will bring up the list of available resources to alias.

Upvotes: 3

Related Questions