That's a limitation of DNS. However, you can route traffic for domain.com and for www.domain.com to your resources without using IP addresses if you're using an AWS service that supports Route 53 alias resource record sets. For more information, see "Choosing Between Alias and Non-Alias Resource Record Sets" in the Amazon Route 53 Developer Guide:
Note that if you're using an S3 bucket that's configured as a website endpoint, you need to create a second bucket and configure it as a redirector. This is explained in "Getting Started with Amazon Route 53":
Scott, thanks for your reply. I'm a bit of a noob with this type of DNS configuration and I don't think I fully understand what the article is recommending I do.
I have a cname setup for www.domain.com and it's working properly.
I have an A recomrd setup for domain.com that points to an IP address. It's working properly as well.
I'd like to replace the A record for domain.com with a CNAME for domain.com.
Can you walk me through what the settings should be for that?
When I try to create a CNAME for domain.com, I'm unable to do because I need to give the CNAME a name i.e. "www".
The short story is that you can't create a CNAME for domain.com because DNS forbids creating CNAME records at the root of a domain. Various DNS services offer workarounds; with Route 53, the workaround is to create an alias record. However, you can create an alias record only if the resource that you're routing your traffic to is a CloudFront distribution, an S3 bucket, an Elastic Beanstalk environment, or an ELB load balancer.
You created a CNAME record to route traffic from www.domain.com to domain.com. Nothing more to do there.
If you're using one of the resources listed above, you can create an alias record for domain.com. That saves you the trouble of specifying an IP address.
If you're using another resource, such as a web server running on an EC2 instance, you need to specify an IP address somewhere so Route 53 knows what IP address to return in response to DNS queries for www.domain.com and domain.com. That's the A record that you currently have for domain.com. Everything is working properly, so you're done. :-)
Why is safari telling me that it cannot find server for my backend website?asked 3 months ago
A cancelled spot request has not been disappeared for a long timeasked 19 days ago
Cloudfront non-www URL routing to other siteasked 5 months ago
When URL with www does not resolveasked 3 years ago
How to add a CNAME without Root Access?Accepted Answerasked 3 years ago
www redirect in amplify console infinitely redirectsasked 3 years ago
Amplify redirect www to apexasked 10 months ago
CNAME for domain.com without wwwasked 6 years ago
"www" address of websiteasked 3 years ago
WWW and Non-WWW is clashing in Wordpress. Help!asked 4 years ago