---
title: "Discussion on \"The Domain That Wouldn't Move: Fighting a Ghost CNAME Across AWS Accounts\" | Hashnode"
description: "Discussion on \"The Domain That Wouldn't Move: Fighting a Ghost CNAME Across AWS Accounts\". CloudFront locked our domain to a blocked AWS account. Here's how I forced the CNAME back using a TXT record and the AWS CLI"
url: "https://hashnode.com/posts/cnamealreadyexistsexception-cloudfront-fix/6a7416ed242c084ee1f0f59e"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [The Domain That Wouldn't Move: Fighting a Ghost CNAME Across AWS Accounts](https://arnavlogs.hashnode.dev/cnamealreadyexistsexception-cloudfront-fix?utm_source=hashnode&utm_medium=feed)

CloudFront locked our domain to a blocked AWS account. Here's how I forced the CNAME back using a TXT record and the AWS CLI

Aug 6 · 7 min read · arnavlogs.hashnode.dev  
Read the article

-   [#aws](https://hashnode.com/tag/aws)
-   [#cloudfront](https://hashnode.com/tag/cloudfront)
-   [#dns](https://hashnode.com/tag/dns)
-   [#certificate](https://hashnode.com/tag/certificate)
-   [#cloud](https://hashnode.com/tag/cloud)
-   [#route-53](https://hashnode.com/tag/route-53)

## Written by

[Arnav Mahajan](https://hashnode.com/@oceanwhisperer)

@oceanwhisperer · Mumbai, India

  
[View profile](https://hashnode.com/@oceanwhisperer)

Code, Contained: Exploring Backend Systems and Scalability

I’m a rising engineer who believes the best way to learn is to teach. Whether I’m optimizing a Go backend, managing infrastructure on AWS, or diving into Operating Systems, I write about my journey to solidify my own mental models and help others do the same. When I'm not coding, you'll likely find me in a Hackathon or Exploring emerging Fields in Computer Science

## Responses 1

Markdown supported · ⌘↵ to post

[CDN Edge Ops](https://hashnode.com/@cdnedgeops)

[Nov 10](https://hashnode.com/posts/cnamealreadyexistsexception-cloudfront-fix/6a7416ed242c084ee1f0f59e/comment/6af261aa1491a789dd3d9459)

Ghost CNAMEs across AWS accounts usually mean the alias target is still owned by another distribution or a leftover hosted zone record, not a flaky DNS provider. Prefer an inventory that lists every CloudFront alias and Route53 alias for that hostname before you recreate anything, detach or delete the old distribution only after the alias is released, and wait for global DNS to drop the prior target before attaching the new one. Keep ACM certificates and alternate domain names on the same account boundary so a cross-account move cannot leave a half-attached name.

Ops prove-out after reclaiming the hostname: resolve the name from more than one public resolver and confirm it points only at the new distribution, then request the Host through the edge and read the served certificate SAN plus cache status. Watch CloudFront 4xx and alias conflict metrics for one deploy window — a lingering CNAMEAlreadyExists or wrong cert usually means another account still holds an alternate domain name. Keep a canary Host that never moved so you can tell a DNS propagation lag from a real ownership clash.
