Back to blog

04 Nov 2026

Subdomain Takeover and Dangling DNS: Detection and Fix Guide

A subdomain takeover happens when one of your subdomains still points to a cloud service you deleted. An attacker claims that same service name, and suddenly they control content on your subdomain, with your brand and your cookies' trust.

The cause is almost always a dangling DNS record: a CNAME or other record left behind after a resource was removed. Here is how to find them and stop them for good.

Subdomain takeover through a dangling DNS record
How It Works

How a Subdomain Takeover Happens

  1. A team creates promo.yourbrand.com with a CNAME to a cloud app, storage bucket or hosted page
  2. Months later, the cloud resource is deleted, but the DNS record stays
  3. An attacker finds the record and creates a resource with the same name on the same provider
  4. The subdomain now serves the attacker's content

The attacker never touches your DNS. Your own record sends visitors to them.

Common Sources

Where Dangling DNS Records Come From

Service type Example record target Typical cause
Cloud web apps yourapp.azurewebsites.net App deleted, CNAME kept
Object storage sites bucket name on a storage website endpoint Bucket removed
Hosted pages yourorg.github.io Repo or Pages site removed
SaaS landing pages and help desks custom domain on a SaaS provider Subscription cancelled
CDN endpoints custom endpoint on a CDN Endpoint deleted

Teams creating subdomains outside central IT make this worse. See shadow IT domains.

Why It Matters

What Attackers Can Do With Your Subdomain

  • Host phishing pages under your real brand
  • Steal cookies scoped to your parent domain
  • Get SSL certificates issued for the subdomain
  • Damage SEO with spam content
  • Bypass email and content security filters that trust your domain
Find Them

How to Detect Dangling DNS Records

  1. Export every DNS zone you own, including old ones
  2. List all CNAME, A and ALIAS records that point to cloud or SaaS providers
  3. Check each target: does it still resolve to a resource you own?
  4. Flag errors such as NXDOMAIN on the target or provider "no such app" pages
  5. Repeat monthly, or run it automatically

Your security team or a VAPT engagement can include this as a standard check.

Fix and Prevent

A Simple Process That Stops Takeovers

Rule How to apply it
Delete DNS before the resource Make DNS removal step one in any decommission checklist
Own the inventory Every subdomain has an owner and purpose
Control who creates records Roles and approvals on DNS changes
Automate checks Scheduled scans for dangling targets
Use provider verification Turn on domain verification features where the cloud provider offers them

Managing many zones? Read subdomain management and consider premium cloud DNS with change control.

Real-World Examples

Takeover Risks We Found and Fixed

SaaS Company Removes 14 Dangling Records

Client: B2B SaaS company, Bengaluru

Challenge: Product, demo and test subdomains had been created by several teams. Some pointed to deleted cloud apps.

What we did: Zone export, target checks, deletion of 14 dangling records, approval workflow for new DNS records, monthly automated scan.

Results:

  • All dangling records removed in one day
  • No new dangling records in six months of scans
  • DNS controls passed a customer security review

GCC Cleans Up Old Campaign Subdomains

Client: Global capability centre, Hyderabad

Challenge: Marketing pilots left dozens of campaign subdomains pointing at expired SaaS landing pages.

What we did: Inventory with owners, removal of unused records, decommission checklist added to the marketing tool process.

Results:

  • 23 subdomains retired
  • Takeover risk on the parent brand closed
  • New subdomains now need IT approval
Takeaway

Clean DNS Is Safe DNS

Subdomain takeovers are easy to prevent once you know where to look. Delete DNS records before deleting resources, keep an inventory with owners, control who can add records and scan regularly.

Need help? Flying Stars reviews and secures DNS as part of domain protection services and DNS management services.

Explore More

More Services

Explore Related Blogs



Get the latest news and
blog updates