Subdomain takeover meaning, in plain words

Subdomain takeover claims an abandoned DNS record to host content under your domain. The gap dangling DNS creates and the decommission order OWASP recommends.

Written by: Mio Kanzaki(Security Analyst (AI))Reviewed by: 千葉圭介Updated

Subdomain takeover lets an attacker claim an abandoned DNS record and serve content under your domain. A subdomain is a name such as blog.example.com placed in front of your organization's domain. OWASP describes cases where a DNS record — typically a CNAME — still points to a decommissioned cloud resource or external service. When an attacker registers that resource, they can serve any content under your subdomain.

How does subdomain takeover work?

Imagine a directory sign outside a closed shop remaining in place, while someone else moves into the empty premises. Customers who follow the sign believe they have arrived at the original business. A DNS record plays the role of that sign.

OWASP describes the sequence: a DNS record is created to point to a blog-hosting service, that service is canceled a few months later, but the record is left in place. When an attacker registers the same resource name, they gain control of what appears at that subdomain.

The underlying cause is operational rather than technical. Cloud resources are temporary, but DNS records persist, and the teams managing them are often separate. OWASP recommends regular automated checks. For the detailed testing process, see the subdomain takeover vulnerability page.

Why does subdomain takeover matter?

The harm is not limited to defacement. OWASP lists the following potential consequences: theft of cookies scoped to the parent domain, bypassing a CSP that trusts the subdomain, hosting a phishing site on a trusted domain, abusing OAuth or SSO flows, obtaining a TLS certificate, and — when an MX record is involved — receiving email sent to that subdomain.

OWASP's Web Security Testing Guide notes that the record types that can be targeted include A, CNAME, MX, NS, and TXT records. NS records carry the greatest risk because a takeover there could affect control over the entire DNS zone.

OWASP's recommended decommission order is: update or delete the DNS record first, wait for the change to propagate, then retire the cloud resource. Retiring the resource first leaves a gap during which a takeover is possible. Beyond the decommission procedure, maintaining an inventory that links each DNS record to its resource, responsible owner, and planned retirement date makes the checks manageable. Items worth confirming:

  • Check that no unused subdomain records remain in DNS.
  • Confirm that the service each record points to is still active.
  • Know who owns each record and when it is due for retirement.
  • Include updating the DNS record as the first step in any service decommission procedure.

Related terms

  • DNS spoofing: a technique that sends users to a fake site by injecting false DNS address records.
  • CSP: a browser directive that specifies which origins are allowed to load scripts and other resources.

Frequently asked questions

How do you check whether any of your subdomains have been taken over?

Start by listing your DNS records and checking whether the resource each one points to is still yours. OWASP also recommends regular automated checks.

What do you do before decommissioning a service?

OWASP's recommended order is: update or delete the DNS record first, wait for the change to propagate, then retire the cloud resource. Retiring the resource first leaves a gap during which a takeover is possible.

Next step

For a detailed look at the testing and remediation process, see the subdomain takeover vulnerability page. The free URL check shows what your domain's DNS configuration looks like from outside. To inventory your subdomains, contact us.

Frequently asked questions

How do you check whether any of your subdomains have been taken over?

Start by listing your DNS records and checking whether the resource each one points to is still yours. OWASP also recommends regular automated checks.

What do you do before decommissioning a service?

OWASP's recommended order is: update or delete the DNS record first, wait for the change to propagate, then retire the cloud resource. Retiring the resource first leaves a gap during which a takeover is possible.

See what an attacker can see, today

The free URL check returns a grade in under a minute. For costs and next steps, book a free consultation.