简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM