← Blog
// RED TEAM · OSINT

Subdomain takeover: how a forgotten CNAME ends up being yours

Published Aug 12, 2026 · 7 min read
Red TeamBug BountyDNSOSINT

The story is always the same. Someone set up blog.yourcompany.com pointing with a CNAME at a Heroku app, or an S3 bucket, or GitHub Pages. Months later the service is decommissioned… but nobody deletes the DNS record. The target is now empty and claimable. An attacker registers that same name at the provider, and suddenly blog.yourcompany.com —a legitimate subdomain, with your brand and your HTTPS padlock— serves their content.

Why it hurts more than it looks

The cause: "dangling" DNS records

A dangling record is a CNAME (or ALIAS/NS) pointing at a third-party resource that no longer exists or is no longer yours. The provider returns a recognizable error page —NoSuchBucket, There isn't a GitHub Pages site here, No such app— which is both the sign of the flaw and the invitation to claim it. Historically affected services: S3, GitHub Pages, Heroku, Azure (blob/cloudapp), Shopify, Fastly, Surge, Netlify, Zendesk… the list is long and alive.

How it's hunted (recon)

  1. Enumerate the target's subdomains: Certificate Transparency, passive DNS, dictionary brute force.
  2. Resolve each one and keep those with a CNAME to third-party services.
  3. Fingerprint the response: does it return one of those "unclaimed service" error pages?
  4. Confirm without exploiting: in a legit pentest or bug bounty, proving it is claimable is enough; do not publish content on someone else's domain beyond an agreed PoC.
🏴‍☠️ The Subdomain Takeover detector does exactly steps 2 and 3: it checks subdomains pointing at abandoned services and flags those that fingerprint as claimable. For step 1 (discovering subdomains via Certificate Transparency, WHOIS and more) there's passive recon and the DNS Lookup.
⚠️ This is only legitimate against your own domains or with explicit permission (scoped pentest, bug bounty program). Claiming a third party's subdomain without authorization is domain hijacking: subject to legal consequences.

How to close it (defense side)

Checklist

A subdomain takeover exploits no 0-day: it exploits forgetting. Your attack surface is not only what you deploy, it is also what you stop deploying and never clean up. A boring DNS inventory is the best defense against this quietly dangerous flaw.

Share: LinkedIn X
Sergio Belmonte Morales
Sergio Belmonte Morales
Cybersecurity Analyst · SOC · Sentinel/KQL specialist