How to Detect & Prevent Dangling CNAME Subdomain Takeover Attacks
Identify abandoned DNS alias pointers and reclaim vulnerable cloud endpoints before attackers exploit them.
A subdomain takeover occurs when a DNS CNAME record points to an external cloud service (AWS S3, GitHub Pages, Heroku, Shopify, Zendesk) that has been deleted or unclaimed. An attacker can register the abandoned resource name with the provider and take full control of your branded subdomain.
Root Cause Analysis
Developers point a DNS CNAME to a cloud service during development or campaigns. When the cloud bucket or app is deleted, the DNS record is forgotten in DNS management, creating a dangling pointer.
Step-by-Step Resolution Procedure
Use the Dangling CNAME Scanner above to verify whether your subdomain points to an unclaimed cloud target.
Log in to your DNS provider (Cloudflare, Route 53, Namecheap) and purge any unused CNAME or A records.
Regularly audit zone files against cloud provider provisioning states to eliminate stale records.
Verification Command or Config Pattern
; VULNERABLE: Pointing to deleted S3 bucket or GitHub repo
; assets.example.com. CNAME mycompany-old-bucket.s3.amazonaws.com.
; SECURE: Direct root address or managed verified endpoint
assets.example.com. CNAME d111111abcdef8.cloudfront.net.Frequently Asked Remediation Questions
What can an attacker do with a taken over subdomain?
Attackers can serve phishing pages under your trusted brand name, steal session cookies scoped to parent domains (e.g. .example.com), and bypass CSP security policies.
Which cloud services are most vulnerable to takeover?
Amazon S3 buckets, GitHub Pages, Heroku apps, AWS Elastic Beanstalk, Zendesk Help Centers, Fastly CDN pools, and Surge.sh deployments.
How do I know if a CNAME is dangling?
If the target host returns a signature error like 'NoSuchBucket', 'There isn't a GitHub Pages site here', or 'No such app', the resource is unclaimed and vulnerable.
Does DNSSEC prevent subdomain takeover?
No. DNSSEC verifies cryptographic integrity of the DNS response itself, but cannot verify whether the third-party cloud resource actually exists.
Complementary Diagnostic Scanners
All 34 toolsWCAG Accessibility & Contrast Scanner
Audits foreground/background luminosity contrast ratios against WCAG 2.2 AA (4.5:1) and AAA (7:1) thresholds, detecting missing alt attributes and keyboard traps.
Robots.txt & Sitemap.xml Scanner
Verifies syntax of robots.txt files, parses nested sitemap_index.xml structures, and audits for broken URLs, conflicting directives, and 404 indexing errors.
Website Font, Color & Asset Scanner
Crawls live stylesheets to extract distinct hex color palettes, webfont load methods (WOFF2/FOUT metrics), and total uncompressed asset payload distribution.
Related Troubleshooting & RFC Playbooks
How to Fix SPF PermError: 'Too Many DNS Lookups' (RFC 7208)
Resolve the 10-lookup limit that causes receiving mail servers (Gmail, Outlook) to reject your emails.
How to Fix NET::ERR_CERT_AUTHORITY_INVALID SSL Handshake Errors
Repair broken intermediate certificate bundles and establish a trusted X.509 chain of trust.
How to Fix ERR_TOO_MANY_REDIRECTS & Circular Redirect Loops
Diagnose infinite HTTP 301/302 redirects between Cloudflare Flexible SSL, Nginx, and CMS canonical rules.