Can't add AWS amplify ANAME to freenom domain DNS

Viewed 937

I'm trying to add my custom domain from freenom to my AWS amplify app. The AWS suggests that I have to add an ANAME record (which I read is just called A on freenom) for the target: 123example456.cloudfront.net. When I try to add that url to my freenom target I get the error:

Error occured: Invalid value in dnsrecord

Also, AWS's instructions say:

If you are migrating a custom domain that is already serving production traffic, please wait until your new application loads successfully at the .cloudfront.net url shown below before updating your DNS records:

Thus far the .cloudfront.net address gives a 404, I guess it might take some time for it to start working, but am not sure if it is longer than what has passed thus far (about 2 hours or something).

I've managed to get the url with www to work by using CNAME, using the amplify app url, as in:

www CNAME master.d2cnacuo0erb7y.amplifyapp.com 

but this also doesn't work for ANAME, so I can't get the domain without www to work. When I add the cloudfront url to the CNAME freenom allows it, but it gives the 404, while for the ANAME record it gives that error when I try to add it.

I've read this question, but the only answer provided involves Route 53, I had Route 53 setup and working but decided to remove it because I was being charged for it.

Why can't I add the url to the A record on Freenom?

2 Answers

“A” records (ie alias) only support IP addresses as values. That is why you are getting an error. CNAME is the record type you want when you want a URL as a value.

Route53 is a special case and since Cloudfront and Route53 are both AWS products they have special integrations that will allow you to create an A record for cloudfront resources identified by a url. Behind the scenes, Route53 gets the IP from cloudfront and will update the A record when/if the IP changes. AWS doesn’t expose this functionality for other DNS providers (ie freenom)

I had a similar experience. The instructions on the dns records pop-up are ambiguous.

Your amplify app will never load on the .cloudfront.net url. AWS only uses it to set up a cloudfront distribution for your site. Just do the CNAME and the AAA records. Once the records complete propagation, your site will be up on the custom domain name.

Related