简体   繁体   中英

Forward traffic from www subdomain to apex domain in AWS Route 53

My site works with www.mydomain.com , but when I browse to mydomain.com, there is no IP address found. I am trying to use Route 53 and create an ALIAS record from mydomain.com to www.mydomain.com . All the documentation and help on the Internet says to create an alias record. However, ALIAS is not a record type that is available from the drop-down. How does on create an alias record in Route 53?

I understand that mydomain.com is what is referred to an an "apex record", is that right?

The alias record is an option in a record type, not an independent record type as show for example here .

In Route53 to redirect mydomain.com to www.mydomain.com you can create simple record with Alias to other record option:

在此处输入图片说明

I got it working by creating an A record pointing to the Github IP addresses that host my webpage. It wouldn't let me create an A record pointing to www.mydomain.com

An APEX record is the "naked domain" marked with a leading @ symbol often. They don't have aliases usually, just IPs. AWS allows you to set an alias to it due to their own DNS extension. You can still create subdomains and point to any other name/address.

Take this as an example of what the DNS zone file would look like (ipv4/ipv6):

yourdomain.com.        IN A         <first github pages ipv4 address>
yourdomain.com.        IN A         <second github pages ipv4 address>
yourdomain.com.        IN A         <third github pages ipv4 address>
yourdomain.com.        IN AAAA      <github pages ipv6 address>
www                    IN CNAME     <first github pages address>
www                    IN CNAME     <second github pages address>

To get your whole domain pointing to github pages, you need to add the IP address / addresses to the first A record in the example above.

You can find the IP addresses for GitHub pages on this link:

185.199.108.153
185.199.109.153
185.199.110.153
185.199.111.153

https://docs.github.com/en/github/working-with-github-pages/managing-a-custom-domain-for-your-github-pages-site#configuring-an-apex-domain

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