A subdomain takeover can happen when a subdomain still points to a service that your organization no longer controls. The DNS record may remain after a test app, hosted page, or cloud resource has been removed. If someone else can claim the abandoned resource, they may be able to serve content at a name that users already trust.

This issue sits at the boundary between DNS hygiene and asset ownership. It is also one reason I treat subdomain inventory as part of regular security work, alongside the broader discovery described in my guide to External Attack Surface Management (EASM).

What is a subdomain takeover?

A subdomain is a name beneath a domain, such as app.example.com or status.example.com. DNS records tell browsers and other clients where to find it. A CNAME record, for example, can point a subdomain to a hostname managed by an outside hosting provider.

A takeover risk appears when the DNS record remains active but the destination has been deleted, disconnected, or is otherwise available for another customer to claim. The exact conditions depend on the provider. A DNS record by itself does not prove that a subdomain is vulnerable, and a provider error page alone is not enough to confirm a takeover.

The practical problem is a mismatch: your DNS still advertises a destination, while your team no longer controls the resource behind it.

How the risk develops

Subdomains are created for real work: product launches, campaign pages, staging environments, documentation, customer portals, and vendor integrations. The teams who create them may later change tools or move on. DNS cleanup can be missed during that transition.

A common lifecycle looks like this:

  1. A team creates a subdomain and points it to a hosted service.
  2. The service is retired, or the account and resource are removed.
  3. The DNS record is left behind.
  4. The provider's old resource name becomes unassigned or claimable.
  5. A different party may be able to attach that resource and serve content through the subdomain.

Not every abandoned DNS record is exploitable. Providers have different safeguards, and some destinations cannot be claimed by another customer. Still, stale records deserve investigation because the subdomain remains part of your public footprint.

Why a trusted subdomain matters

People and automated systems may trust a subdomain because it belongs to a familiar organization. Depending on the name and how it is used, unexpected content could confuse visitors, affect a campaign or support workflow, or create a place to host content that appears connected to the organization.

The risk can extend beyond what a visitor sees. A subdomain may have cookies, authentication flows, integrations, or links associated with it. Those details vary by application, so assess the actual configuration rather than assuming every subdomain has the same impact.

Treat this as an ownership and lifecycle issue. A secure process needs to track who owns each name, what service it points to, why it exists, and how it will be retired.

How to find stale subdomains safely

Start with records and systems your organization is authorized to review. You do not need to attempt to claim a resource to identify a record that needs attention.

1. Build an inventory

Collect subdomains from your DNS provider, infrastructure-as-code repositories, cloud accounts, deployment settings, and service catalogs. Compare these sources because no single list is guaranteed to be complete.

For each name, record:

  • The business or technical owner
  • The purpose of the subdomain
  • The DNS record type and current target
  • The service or provider responsible for the target
  • Whether it is production, staging, temporary, or retired
  • A review date or expected retirement date

2. Review third-party targets

Look closely at CNAME records and other records that send traffic to hosted platforms or vendor services. Confirm in the provider account that the organization still owns the referenced resource and that the configuration is intentional.

A hostname that looks unfamiliar is a reason to ask its owner, not a conclusion that it is vulnerable. Check the provider's current documentation and your account state. Error messages and automated scanner results can be useful signals, but verify them before assigning severity.

3. Check for ownership gaps

Ask the responsible team to confirm that the resource exists, is attached to the right account, and is still needed. If nobody can identify an owner, treat that as an inventory gap and escalate it for resolution.

Review old project documentation and deployment pipelines too. A manual DNS record may outlive the code or service that originally explained it.

4. Use authorized security checks

Use a scanner or internal review process that is designed to assess assets you control. Keep checks within your organization’s authorized scope. Do not attempt to register, attach, or modify a third-party resource as a way of testing whether it is claimable.

If a tool flags a potential dangling record, verify the DNS target, provider behavior, and resource ownership with the team or vendor. Record what evidence supports the finding and what remains uncertain.

How to prevent subdomain takeover

Prevention depends on good ownership and cleanup habits more than on a single DNS setting.

Remove DNS records during decommissioning

Make DNS cleanup part of the service retirement checklist. Before deleting a hosted resource, identify every DNS record that points to it. Remove or update those records, then verify the expected DNS state after the change.

If you must remove a resource before changing DNS, coordinate the sequence with the owner and provider. Avoid leaving a public record pointing at a resource that no longer belongs to you.

Keep an owner for every subdomain

Assign a team or person to each active subdomain. Review records with missing owners, unknown purposes, or expired review dates. Ownership makes it easier to distinguish a deliberate integration from forgotten configuration.

Automate lifecycle changes

Where practical, manage DNS alongside the infrastructure or application that depends on it. Infrastructure-as-code and deployment workflows can make creation and removal more repeatable, while review steps can catch records that do not match the expected state.

Automation still needs clear ownership and careful change review. A pipeline can consistently preserve a mistake if its source of truth is out of date.

Monitor changes and exceptions

Review DNS changes and maintain a list of approved third-party destinations. Periodically compare DNS records with provider accounts and active services. Prioritize records that point to retired projects, personal accounts, temporary environments, or services with no clear owner.

External Attack Surface Management can help teams keep an eye on public assets and unexpected changes. A service such as VeilScan may be relevant as one way to monitor an external footprint, but it does not replace verifying resource ownership and cleaning up DNS at decommission time.

A subdomain security checklist

Use this short checklist during reviews and service shutdowns:

  • [ ] List subdomains from DNS, cloud, deployment, and service inventory sources.
  • [ ] Assign an owner and purpose to each active name.
  • [ ] Identify CNAME and other records that point to third-party services.
  • [ ] Confirm the target resource exists in an account your organization controls.
  • [ ] Remove or update DNS records when the related resource is retired.
  • [ ] Recheck DNS after cleanup and document the result.
  • [ ] Investigate scanner alerts through authorized provider and account checks.
  • [ ] Schedule recurring reviews for temporary and vendor-managed subdomains.

Frequently asked questions

What is a subdomain takeover?

It is a risk where a DNS name continues to point to an external service or resource that the organization no longer controls, and another party may be able to claim that destination under the provider's rules.

Does every dangling CNAME mean a takeover is possible?

No. Claimability depends on the provider, the resource state, and the specific configuration. A dangling record is a signal to investigate, not proof by itself.

How do I fix a potentially vulnerable subdomain?

Confirm the record and destination with the owner and provider. If the destination is no longer needed, remove or update the DNS record, then verify the resulting DNS state. If the service is still needed, restore or reattach the resource through an account your organization controls.

How often should I review subdomain DNS?

Review DNS during every service retirement and on a recurring schedule. The right cadence depends on how often your organization changes infrastructure, but each active record should have an owner and review date.

Conclusion

Subdomain takeover risk often begins with a simple gap between DNS and service ownership. Keep an inventory, verify third-party targets, assign owners, and include DNS cleanup in decommissioning. Those habits make stale records easier to find and prevent abandoned services from lingering in your public footprint.