Subdomain takeover explained: how a forgotten CNAME lets someone else serve your name
Published 26 Sep 2026 · Updated 26 Sep 2026
How a name gets left behind
A campaign site goes up on Heroku, so promo.example.com gets a CNAME to example-promo.herokuapp.com. A documentation site goes to GitHub Pages, a download area to an S3 bucket, a shop to a hosted storefront. Each is one DNS record pointing a name of yours at a name of theirs.
Months later the campaign ends and somebody deletes the Heroku app. Nobody deletes the DNS record, because it lives in a different place, often with a different team, and nothing breaks. The page simply stops loading, and the record now points at an app name that nobody holds.
Why owning the domain does not help
The record is still yours and still says what it said: for promo.example.com, go to example-promo.herokuapp.com. The problem is on the other side. App names, bucket names and site names on these services are first come, first served. Anyone can create an app called example-promo, add promo.example.com to it as a custom domain, and the service will route that name to their app, because your own DNS already sends the traffic there.
Your registration, your nameservers and your DNS account were never touched.
What someone can do with it
Serve any page they like on your domain. A login form on promo.example.com looks like yours because it is, as far as the browser can tell.
Read cookies meant for you. A cookie your main site sets for the whole domain (Domain=example.com) is sent to every name under it, the claimed one included.
Get a valid certificate. The claimed name answers the certificate authority's HTTP challenge from their server, so they can serve it over HTTPS with a padlock.
Pass your own allowlists. Anything that trusts every name under your domain, such as a CORS rule, a content security policy or a list of allowed login redirects, now trusts them too.
Which records are at risk
The risk is a CNAME (or a chain of them) that ends at a provider name nobody holds, on a provider where anyone can claim that name. Heroku app names, S3 buckets, GitHub Pages sites, Azure app and storage names, Netlify, Fastly, Pantheon and Surge sites have all been claimed this way.
Some targets are not claimable. A provider that hands out a random target per customer, or that makes you prove you own the domain before it will serve it, leaves only a stale record behind. That is untidy and worth removing, but nobody can take it over. GitHub, for one, lets you verify a custom domain so nobody else can use it for Pages.
A related problem is an A record left pointing at a cloud address you released, which the provider may later give to another customer. It is harder to spot from the outside, and nothing here judges it.
Checking one name with dig
dig +short CNAME promo.example.com
dig example-promo.herokuapp.com | grep status
The first command prints where the name points. The second asks whether that target still exists; a status of NXDOMAIN means it does not. If the target sits at one of the providers above and does not exist, the name is open to takeover.
Doing that for one name takes a minute. Doing it for every name that has a CNAME is the hard part, because nobody keeps a complete list of the names under a domain. The subdomain finder builds one from the domain's own DNS records, its homepage and a list of common names, and says which names are live, gone or pointing nowhere.
Fixing one
Remove the record. If the name is still wanted, create the app, bucket or site again under your own account first and then keep the record. Do it before anyone else notices.
Discover and a subdomain watch judge every name they find for takeover. Discover runs when you ask; a subdomain watch runs the same look every day and alerts when a name becomes open to takeover, then again when it is fixed. Run one before you close the ticket on the first record, since a team that left one record behind usually left more.
Check it now
Watch it for good
Watch this for good.
Start free