What is Subdomain Takeover? How It Works, the Damage and Prevention
One of your subdomains quietly serving someone else's content: that is what a dangling DNS record can lead to.
Published: November 13, 2026 · 日本語
What is going on
Companies build campaign sites, help centers, blogs and test environments on cloud and SaaS platforms and give them subdomains such as campaign.example.com. This is often done with a CNAME record, like this:
campaign.example.com. CNAME example-campaign.some-cloud.example.
When the campaign ends, the resource on the cloud side (the site or bucket) gets deleted, but the CNAME in DNS is sometimes left behind. That is a dangling DNS record. On some services anyone can create a new resource with the same name, which means someone else can take over where your subdomain points. That is subdomain takeover.
What damage it can do
- Phishing and scam sites: an attacker can publish a fake sign-in page under your real domain name, and users trust it because of the domain.
- Cookie theft: cookies (session data) scoped to the whole parent domain may be sent to the hijacked subdomain and stolen.
- Abuse of allowlists: if CORS, CSP or OAuth redirect settings allow "any of our subdomains", the attacker gets to use that permission.
- Loss of trust: inappropriate content served from your domain hurts your search ranking and your brand.
When a takeover is possible
Not every cloud service allows takeover. If the service verifies ownership of each domain for a resource, nobody else can claim the same name. Services where anyone can create a resource as long as the name is free are the dangerous ones. Whether takeover is possible differs by service and can change, so check public projects that maintain lists of affected services.
The same risk exists beyond cloud services:
- The CNAME points at a domain that has expired and become unregistered (anyone can register it).
- A subdomain is delegated (NS records) to nameservers that have been shut down or can be taken over. This is especially serious: everything under that subdomain comes under someone else's control.
How to check for yourself
- List the subdomains you manage. Besides the list in your DNS settings, Certificate Transparency (CT) logs reveal subdomains that left a record (try the Subdomain Finder).
- Look up each subdomain's CNAME target and check whether the target name exists (resolves). If it does not, the record is likely dangling.
- Even when the target resolves, some services show an error page such as "this site does not exist" in a browser. In that case someone else may be able to create the same name, so check that service's behavior.
The Subdomain Takeover Scanner does steps 1 and 2 automatically and flags CNAMEs whose target does not exist or points at a domain that may be unregistered. Cases that need the browser check in step 3 are shown as "needs review".
How to prevent it
1. Keep the order: DNS first, then the resource
When removing a service or resource, delete the DNS record first and the resource afterwards. Do it the other way round and there is a gap in between.
2. Keep a subdomain inventory
Record which subdomain is run by whom, for what and on which service. That way it can still be reviewed after people change roles.
3. Scan automatically and regularly
A yearly review cannot keep up with how quickly takeovers happen. Set up regular checks, monthly for example.
4. Use ownership verification
If the service supports domain ownership verification (a TXT record, for example), always set it up. It stops anyone else from claiming the same name.
5. Avoid wildcard DNS you do not need
A wildcard CNAME such as *.example.com resolves even names that do not exist, which makes problems harder to spot. Limit it to what you actually need.
FAQ
Can takeover happen on every cloud service?
No. It is unlikely where the service verifies domain ownership. But behavior changes, so rather than assuming a given service is safe, the basic rule is not to leave dangling records.
Is it fine to leave unused CNAMEs in place?
Delete any CNAME whose target does not exist, because it is a takeover risk. There is almost no benefit to keeping unused records.
We have too many subdomains to keep track of.
Start by building a list from CT logs and your DNS settings. Then set up a regular scan, monthly for example, and keep checking for newly dangling records.
Check your own domain
Enter your domain and the points in this article are checked for free. No sign-up.
Scan for subdomain takeover for free