简体   繁体   English

如何将根域重定向到 AWS route53 中的子域?

[英]How to redirect the root domain to a sub domain in AWS route53?

I'm using AWS route53 as my DNS server.我使用 AWS route53 作为我的 DNS 服务器。

I have an A Record pointing a webserver for the sub-domain www and CNAME for the root "@" subdomain which points to the www sub-domain, so when I try to get mydomain.com or www.mydomain.com I should get the same result and It works fine in Godaddy DNS and NameCheap DNS servers but in route53 the www record works fine but the @ doesn't work and I have to type the full www.mydomain.com for me to get the site back.我有一个 A 记录指向子域 www 的网络服务器和指向 www 子域的根“@”子域的 CNAME,所以当我尝试获取 mydomain.com 或www.mydomain.com 时,我应该得到相同的结果,它在Godaddy DNS 和NameCheap DNS 服务器中工作正常,但在 route53 中,www 记录工作正常,但 @ 不起作用,我必须输入完整的www.mydomain.com才能恢复站点。

In this situation, you don't need to include the @ symbol when creating record sets for your domain.在这种情况下,在为域创建记录集时不需要包含@符号。

According to the docs ,根据文档

If you're creating a record that has the same name as the hosted zone, don't enter a value (for example, an @ symbol) in the Name field.如果您要创建与托管区域同名的记录,请不要在名称字段中输入值(例如 @ 符号)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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