Dangling DNS records that let someone take over your subdomain

Last updated November 12, 2026
Steps
- Export every DNS record for your domain from your registrar or DNS host (Cloudflare, your registrar, Vercel DNS and so on) into a sheet.
- For each CNAME, A/AAAA and MX record, write down what it points to and whether that app, bucket, page or account still exists and belongs to you. Pay extra attention to records pointing at hosting, storage, CDN, docs, status-page, help-desk and email services.
- Visit each subdomain in a browser. A provider error page such as “no such app,” “project not found” or “bucket does not exist” is a red flag that the name is dangling.
- Delete DNS records for anything you no longer run. MDN’s rule: when taking something down, remove the DNS record first; when setting something up, claim the virtual host first and create the DNS record last.
- Where your hosting provider offers domain verification (a TXT record proving you own the domain), use it, so another account can’t attach your subdomain.
- Scope session cookies to the exact host that needs them instead of the whole parent domain, and keep CSP and CORS allow-lists to the specific subdomains you actually use instead of *.yourdomain.com.
- If a subdomain has already been taken over, remove its DNS record immediately, then check every layer (CDN, hosting) to find where the attacker claimed it.
- Add a DNS check to your launch and shutdown checklist, and repeat the inventory every few months.
Why it matters
MDN explains that a takeover typically happens when a subdomain has a CNAME in DNS but no host is serving content for it, either because the host was never set up or was removed, so an attacker can create their own virtual host for that name. It lists the risks as reading cookies set from the main domain, cross-site scripting and getting around content security policies, which can expose logins. Microsoft’s guidance on dangling DNS adds that attackers can get a valid TLS certificate for a hijacked subdomain, so the padlock in the browser doesn’t prove the page is yours, and that MX records left pointing at removed services can let someone receive email meant for your subdomain. This page is for checking and fixing domains you own.
Sources
MDN Web Docs: Subdomain takeover — https://developer.mozilla.org/en-US/docs/Web/Security/Subdomain_takeovers
Microsoft Learn: Prevent dangling DNS entries and avoid subdomain takeover — https://learn.microsoft.com/en-us/azure/security/fundamentals/subdomain-takeover
Checked at the source on November 12, 2026.
Related patterns
Found a problem you'd rather not fix yourself?
Tell us what's wrong. A StorenTech engineer reviews your app and replies with a fixed quote, so you know the cost before any work starts.
Get it fixed by StorenTechVibe Security Weekly
One email a week with new failure patterns and how to fix them.
By joining you agree we may email you this newsletter. See our privacy policy. Free. Unsubscribe anytime. We'll never sell your email.