Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Receiving error "CNAME already registered with CloudFront" on BitBucket hosting, but I never registered the domain with CloudFront

I am trying to host a websit with only static pages on BitBucket.com using its Add-On Aerobatic. While registering the domain on Aerobatic, its giving me the following error:

CNAME already registered with CloudFront
AWS is reporting that this domain is already registered with a different CloudFront distribution. In order to complete the registration process, you'll first need to disable that distribution.

I never registered the domain with AWS CloudFront and hence can't figure out what is going on.

Any clue to this problem would be greatly appreciated.

Thanks,
Sourin

like image 942
Sourin K Sen Avatar asked Jan 09 '17 11:01

Sourin K Sen


1 Answers

This issue can have several possible causes.

CloudFront treats alternate domain names (which they also call "CNAMEs" even though this doesn't imply that actual CNAME records necessarily exist in DNS) as a single global namespace.

No two CloudFront distributions can have the same alternate domain name, whether in the same AWS account or in different accounts.

Additionally, no two CloudFront distributions can have ambiguous alternate domain names, unless they are owned by the same AWS account. An example of ambiguous names would be *.example.com and www.example.com. This is ambiguous because *.example.com also matches www.example.com. This configuration is accepted and works correctly, but only if both distributions are in the same account.

Additionally, API Gateway edge-optimized APIs use the CloudFront network, so their custom hostnames are part of the globally-unique CloudFront namespace mentioned above, with the additional caveat that ambiguous mappings are not supported when API Gateway edge optimization is used.

Not all of the possible conditions here are directly applicable to the exact circumstances in the question above, but here is a list of some possibilities to consider:

  • another AWS customer who formerly owned the domain still has a CloudFront distribution configured with this hostname, or
  • there may be someone who has configured it on one of their CloudFront distributions by mistake, such as mistakenly creating an alternate domain name value of example.com (your domain) when the intended value should have been example.org (their domain), or
  • you created an API Gateway edge-optimized deployment using this domain. This is not applicable to regional deployments, only edge-optimized.

If you're certain that none of the above conditions are applicable in such a way that you can fix this yourself (i.e. it's not already configured in one of your CloudFront distributions in any of your AWS accounts or in API Gateway) then see How do I resolve the error CNAMEAlreadyExists when setting up a CNAME alias for my Amazon CloudFront distribution? in the AWS Support Knowledge Base for the process to get CloudFront to unlock the domain, using a special TXT record in DNS, followed by an AWS support request.

If you don't have a paid technical support plan, this should also be possible by submitting an account support request, since you are asking them to fix the setup of your account, not fix or troubleshoot your systems or code, etc.

like image 185
Michael - sqlbot Avatar answered Oct 20 '22 01:10

Michael - sqlbot