Search code examples
amazon-web-servicesamazon-route53amazon-lightsail

Can't use Amazon Lightsail DNS to manage apex domain


I have a domain purchased and managed through Route53 in AWS, and I'd like to save money by using Lightsail's hosted zone instead of Route53's. My resource is an AWS Cloudfront CDN which points to an S3 static website. I have already configured my domain to use Lightsail's provided name servers with no issue. My problem is in creating records for my bare (apex) domain.

screenshots: Assignments

DNS

I have no problem creating a record for www.mydomain.org and pointing it at my Cloudfront resource, but trying to set up an alias for the apex domain (mydomain.org without the www) gives the error "Domain labels (strings separated by the '.' delimiter) must be between 1 and 63 characters in length". I have tried using the "Assignments" tab which has an option for the apex domain, but this seems to only allow selecting from a list of lightsail resources, not letting me point at another record or my resource itself.

Is Lightsail just not built for this?


Solution

  • I found out the solution, and it's buried in the docs and not at all obvious. You can create A name records at the apex using the @ character in the subdomain field. Why Lightsail makes you use this special character that means nothing in normal DNS operations instead of allowing a blank subdomain to represent the apex is beyond me.

    https://lightsail.aws.amazon.com/ls/docs/en_us/articles/understanding-dns-in-amazon-lightsail#lightsail-dns-records-supported-in-lightsail