Glossary
Subdomain takeover
Definition
Subdomain takeover: An attack in which a DNS record, often a CNAME, still points to an outside service that has been deleted, and an attacker claims that service's name to serve content, obtain certificates or receive mail on the victim's subdomain.
Also known assubdomain hijackingdangling DNS takeoverdangling CNAME
In short
A subdomain takeover happens when one of your DNS records still points to an outside service you've stopped using, and someone else claims that service's address. They can then serve pages, get a valid certificate or receive mail on your subdomain. The fix is to delete DNS records when you retire a service and to prefer services that require proof of domain ownership.
Key takeaways
- The cause is a leftover, or dangling, DNS record pointing at a resource that no longer exists.
- CNAME records to cloud hosting are the classic case; leftover MX records can expose mail.
- An attacker on your subdomain can get a valid certificate and harvest cookies shared across subdomains.
- Remove the DNS record as part of retiring any service, and audit records regularly.
- Ownership checks with a unique TXT token stop strangers claiming your domain on a service.
Last reviewed 3 December 2026 by Foxcolab Team
A subdomain takeover happens when one of your DNS records still points to an outside service you've stopped using, and someone else claims that service's address. From then on they serve pages, or receive mail, on your subdomain. Microsoft calls the leftover records "dangling DNS" entries and warns that "CNAME records are especially vulnerable to this threat" (Microsoft Learn).
A worked example#
- Marketing launches
promo.example.comas a CNAME to an app calledexample-promoon a cloud hosting platform. - The campaign ends and the app is deleted. Nobody removes the DNS record.
- An attacker scanning for dangling records finds it, creates a new app named
example-promoon the same platform, and from then on your subdomain serves their page.
promo.example.com. CNAME example-promo.cloudhost.example.
^ still published by you
example-promo deleted by you, then claimed by the attackerVisitors see your domain in the address bar, with a padlock.
Why it's serious#
Microsoft lists what follows:
- Your name on their content, from phishing pages to scam downloads.
- Cookie theft. "It's common for web apps to expose session cookies to subdomains," so a page on
promo.example.commay read cookies meant forapp.example.com. - A valid certificate. The attacker "can use the hijacked subdomain to apply for and receive a valid SSL certificate," so the padlock proves nothing.
- Mail. A leftover MX record "could enable threat actors to receive emails directed to legitimate subdomains."
Prevention#
- Put "Remove DNS entry" on the checklist for retiring any service, as Microsoft recommends, and remove the record before or with the service.
- Keep an inventory of every record that points outside your own systems, and review it on a schedule.
- Prefer services that make you prove ownership with a unique TXT record before they accept your domain. Microsoft notes that with its verification record in place, no other customer "can validate the custom domain or take it over."
In Foxcolab#
Foxcolab custom domains work that way. Each domain an organization adds gets its own random ownership token, foxcolab-verify=<token>, and the organization gets the domain only when that exact token appears in the domain's DNS. A domain another organization has verified can't be added at all. A leftover record pointing at Foxcolab therefore doesn't let a stranger claim your domain without access to your DNS.
When you connect a domain, the Domains tab tells you to Remove old mail records first: delete MX records for providers you've left, so no mail flows to a service that isn't yours. See configure custom domains and domain verification.
Ready to move your domain? See plans.
Keep exploring
Related terms
- CNAME recordA CNAME record makes one DNS name an alias of another. It's handy for hosted services, but a name with a CNAME can't hold any other record.
- DNS (Domain Name System)DNS is the internet's directory. It turns a name like example.com into the records computers need, from a website's address to the servers that accept a domain's mail.
- MX recordAn MX record is the DNS entry that names the servers accepting email for a domain and sets the order in which sending servers try them.
- Domain verificationDomain verification is how a service confirms you control a domain before you can use it there, usually by asking you to publish a TXT record with a unique token.
- DNS TXT recordA TXT record is the DNS record that holds free-form text. Email authentication, DKIM keys and domain-verification tokens all live in TXT records.
- PhishingPhishing is impersonation used to trick people into handing over passwords, approving payments or opening malware. Here's how it works and what actually stops it.
Where Foxcolab uses it

Foxcolab
Private work tools, without the ads.
Mail, files, documents, spreadsheets and meetings in one account. Files, documents and spreadsheets are end-to-end encrypted.