Search code examples
amazon-web-serviceshttp-redirectdnsamazon-route53cname

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


I'm using AWS route53 as my DNS server.

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.


Solution

  • 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.