• Dangling DNS Records: What They Are and How to Prevent Subdomain Takeover

Dangling DNS Records: What They Are and How to Prevent Subdomain Takeover

by

Last Updated:
10 min read
Dangling DNS Records: What They Are and How to Prevent Subdomain Takeover

A dangling DNS record is a DNS entry that still points to a resource that no longer exists, such as a deleted cloud service, a decommissioned server, or an inactive third-party platform. The record keeps resolving while the destination behind it is gone, and that gap is what attackers look for.

For IT and security teams the difficulty is rarely finding one broken record. It is holding continuous visibility across domains, subdomains, and authentication records as infrastructure changes underneath them. Every migration, vendor swap, and decommissioned service leaves candidates behind.

Key Takeaways

  1. Dangling DNS records expose domains to significant security risks by pointing to non-existent or decommissioned resources.
  2. Common causes of dangling DNS records include misconfigurations, expired services, and discontinued hosting accounts.
  3. Subdomain takeover attacks can result from dangling DNS records, allowing attackers to control and serve malicious content through compromised domains.
  4. Email authentication records are particularly vulnerable to dangling DNS issues when they reference inactive domains, deprecated senders, or unmonitored reporting destinations.
  5. Both manual auditing and automated DNS monitoring tools are essential for detecting and addressing dangling DNS records effectively.

What Are Dangling DNS Records?

A dangling DNS record is a DNS entry that points to a resource that no longer exists or is inaccessible. Cybercriminals on the internet are always on the hunt for such DNS entries since they are susceptible to information leakage. Some of these entries may contain sensitive information about a domain, becoming a data goldmine for threat actors to benefit from.

Common scenarios leading to dangling DNS

DNS misconfigurations. The Domain Name System is configured separately from the internet resource we want to interact with. DNS records added to the DNS point to these resources, helping us access them. In certain cases, a previously configured resource may get deconfigured by its host. For example, a DNS record was configured by a domain owner to point to a server’s IP. This server is now no longer in use. The DNS record now points to a resource that no longer exists and hence can be termed a “dangling DNS” entry.

Expired or deleted cloud resources. If a cloud service used by a domain owner expires or is deleted, any DNS record pointing to that service becomes a dangling DNS record. This DNS record still remains active, and any attacker can use the resource to serve malicious content.

Deprecated IPs. A company can migrate services to a new provider, while the previous IPs are deprecated. If the team forgets to update or remove the old DNS records, those records become vulnerable to subdomain takeover and can be exploited easily.

Service decommissioning or discontinuation. An email server, hosting account, or third-party service provider is discontinued or decommissioned, however, the DNS records like MX, A, and CNAME records are still active and configured. Attackers can exploit these active dangling DNS records to impersonate the discontinued service.

Which DNS Records Go Dangling, and What Each One Risks

The vulnerability sits in the gap between the DNS layer and the resource layer. A record can be syntactically perfect and still be dangerous when the destination behind it is no longer owned or provisioned. The table below maps that gap by record type.

Record TypeHow It Goes DanglingPrimary RiskRecommended Fix
CNAMETarget alias deleted or hosting account closedSubdomain takeover through a reclaimed CDN or SaaS accountDelete the CNAME or reprovision the target
A / AAAAIP decommissioned or reassigned to another ownerTraffic hijacking and credential interceptionUpdate to the current IP or remove the record
MXMail server decommissioned without DNS cleanupEmail interception and delivery failureRemove or repoint to an active mail host
NSDNS provider changed without updating NS recordsZone hijacking and full domain takeoverUpdate NS to current authoritative servers
TXT (SPF)Deprecated vendor still referenced via include:SPF failure and email spoofingRemove deprecated includes and audit senders
TXT (DMARC)rua or ruf tags point to inactive mailboxesLoss of authentication visibilityRepoint reporting to monitored destinations
DKIM CNAMESending provider account deleted, target goneDKIM signing failure and authentication gapsRemove the CNAME or reprovision with an active provider
TLS-RPTReporting destination inactive or unmonitoredSilent TLS failures go undetectedUpdate rua to an active monitored address

Common Mistake

Treating a successful DNS lookup as proof the record is healthy. A dangling record resolves normally, because the entry itself is valid. What matters is whether your organization still owns and controls the destination. Checking resolution without checking ownership is the reason these records survive audits.

Where dangling records most often appear

Some parts of an estate produce these records far more reliably than others. Knowing which ones lets you audit by likelihood rather than sweeping the whole zone every time.

  • Cloud storage buckets and static site hosts: bucket names are globally unique and freely re-registrable, so a deleted bucket with a live CNAME is among the easiest targets to claim
  • CDN and SaaS vanity subdomains: help.example.com, status.example.com, and careers.example.com usually point at third-party platforms that release the hostname the moment a subscription lapses
  • Marketing and landing page tools: campaign subdomains get provisioned quickly by teams outside IT and are rarely tied to a decommissioning process
  • Staging and test environments: dev, uat, and staging records outlive the projects that created them, and nobody notices because no real traffic depends on them
  • Acquired or subsidiary domains: inherited zones arrive with records whose original owners have left, and documentation rarely comes with them
  • Retired email and support vendors: MX entries, DKIM CNAMEs, and SPF includes for a platform you stopped paying for last year

The pattern connecting them is ownership drift. Each record was created correctly by someone who had the authority to create it, then outlived the relationship that justified it. That is why cleanup belongs to whoever retires a service rather than to whoever administers DNS.

DMARC TXT records

DMARC records are published as TXT records and often include reporting destinations through rua and ruf tags. If those destinations point to inactive or unmonitored mailboxes, teams lose visibility into authentication failures and spoofing attempts without any error surfacing. Review how you publish a DMARC record whenever reporting addresses or owners change.

SPF TXT records

SPF records list authorized sending services through IP addresses and include mechanisms. If an SPF record references a deprecated third-party service or an abandoned domain, authentication becomes unreliable, and an attacker who registers that abandoned vendor domain inherits sending authorization. Records also drift past the 10-DNS-lookup limit as SaaS senders accumulate, so SPF flattening keeps them inside the ceiling. Learn more about SPF.

TLS-RPT records

TLS-RPT records define where SMTP TLS reports should be sent. If the reporting destination is inactive, misconfigured, or no longer monitored, teams miss transport security failures affecting encrypted mail delivery. Learn more about TLS-RPT and MTA-STS.

DKIM CNAME records

DKIM records may be published as CNAME records pointing to a sending provider’s DKIM host. If the provider account is deleted or the target domain goes inactive, DKIM signing and verification break quietly. For example, the subdomain mail.domain.com is an alias for CNAME info.domain.com. Hence when a server looks up mail.domain.com it will be routed to info.domain.com. Your DKIM authentication system is often added to the DNS as a CNAME record.

Note: MX, NS, A, AAAA, CNAME, and TXT records can all become dangling when they reference inactive infrastructure, retired services, or abandoned third-party providers. This article focuses on the email authentication records, because those failures are the ones that stay invisible the longest.

How Dangling DNS Leads to Subdomain Takeover

Hidden DNS vulnerabilities like dangling DNS can lead to domain exploitation and cyber threats. In regulated sectors such as finance, healthcare, education, retail, and the public sector, unresolved DNS and authentication issues also complicate security reviews and audit readiness.

The attack itself follows a predictable sequence, which is useful because it shows exactly where a control breaks the chain.

  1. Subdomain enumeration. The attacker scans your domain for subdomains using public DNS tools, certificate transparency logs, or brute-force enumeration.
  2. Dangling record identification. The attacker finds a CNAME, A, or MX record pointing to an external service that returns a “no such account” or “unclaimed” response.
  3. Resource claiming. The attacker registers that same account, bucket, or hostname on the external platform, whether a cloud storage bucket, CDN endpoint, or SaaS subdomain.
  4. Traffic hijacking. Because your DNS record still points there, every request to that subdomain now routes through infrastructure the attacker controls.
  5. Abuse of inherited trust. The trusted subdomain then serves phishing pages, hosts malware, steals session cookies, sends spoofed email, or collects credentials, all under your organization’s domain name.

What is a subdomain takeover attack?

When an attacker detects a dangling DNS entry that points to a deconfigured resource, the attacker can claim the abandoned resource and route traffic through infrastructure they control. The attacker takes over the (sub)domain that the dangling DNS record points to, thereby routing the entire traffic to an attacker-controlled domain with complete access to the domain’s content and resources.

The damage runs wider than a defaced page. Attacker actions include credential theft through fake login pages, malware hosted on a trusted subdomain, brand impersonation across email and web, session cookie interception, SEO abuse riding your domain authority, email delivery abuse through misconfigured MX or SPF records, and reputation damage that surfaces later in compliance reviews.

Dangling Hostname vs. Dangling DNS Record

The two terms are closely related and get used interchangeably, though they describe different things. A dangling DNS record is the entry itself, a CNAME or A record that still exists in your zone file but points at a removed or unowned resource. A dangling hostname is the subdomain that resolves to a destination nobody at your organization controls anymore.

In practice the record creates the hostname. If dev.example.com has a CNAME pointing to a deprovisioned hosting account, then dev.example.com is a dangling hostname and the CNAME is the dangling record behind it. The distinction matters because scanners flag one or the other, while both need the same remediation: verify ownership of the target, then remove or repoint the record.

How to Detect Dangling DNS Records

Identifying DNS records that are pointing to unprovisioned resources in their early stages can help protect your brand. You can go about it in two ways: manual and automated.

CriteriaManualAutomated
ScalabilityImpractical for large DNS zonesHandles hundreds of domains and subdomains
FrequencyPeriodic, monthly or quarterlyContinuous or near real-time
Risk of human errorHighLow
Ownership validationRequires manual cross-referencingTracked in a centralized inventory
AlertingNoneReal-time alerts on DNS changes and misconfigurations
Best suited toPost-migration or post-decommissioning spot checksOngoing enterprise and MSP DNS posture management

Manual detection

Although time-intensive, a manual audit can help uncover outdated DNS records, especially after cloud migrations, vendor changes, service decommissioning, or sender onboarding.

  • Audit your DNS entries: Cross-check all DNS records in your DNS management system against the active resources in your environment. Look for entries pointing to non-existent services or IPs.
  • Validate DNS configurations: Use tools like nslookup or dig to query each record and verify that the corresponding resource is provisioned and active. A DNS response alone is not proof of safety, so confirm the target is owned and actively managed by your organization.
  • Check for orphaned services: Investigate services such as third-party hosting, cloud platforms, or CDN providers that may have been terminated without removing the associated DNS entries.

For record-by-record validation you can also run each entry through a DNS record checker to confirm what it currently resolves to before deciding whether to keep it.

Why manual detection breaks down at scale

While manual methods are thorough, they are prone to human error and can become unmanageable for domains with large or complex DNS configurations. Several conditions make it unreliable well before a zone gets large.

  • Decentralized DNS ownership across teams and departments
  • Forgotten test and staging environments still holding live DNS records
  • Shadow IT and untracked third-party SaaS integrations
  • Expired cloud resources never linked to a formal decommissioning process
  • Multiple DNS zones inherited through acquisitions or subsidiary domains
  • Thin documentation for legacy infrastructure nobody currently owns

Automated detection

Automated monitoring becomes necessary once domains, subdomains, senders, and cloud services change faster than an audit cycle. Instead of periodic checks, a centralized platform surfaces inactive records, broken authentication configurations, and suspicious changes across the whole portfolio continuously.

The practical gain is timing rather than thoroughness. A quarterly audit will eventually find the same record, but it finds it after a quarter of exposure. Continuous monitoring closes that window to the interval between the service being retired and the next check, which is where the takeover risk actually lives.

How to Fix Dangling DNS Records

Once a dangling record is identified, order matters. Deleting the record before reclaiming the resource can leave a window open, and skipping the TTL step means your fix takes hours to propagate instead of minutes.

  1. Identify the record and its target. Use DNS tools or a monitoring platform to locate the specific entry and what it currently resolves to.
  2. Verify ownership of the target. Confirm whether your organization still controls the destination by querying the provider or account registry.
  3. Lower the TTL first. Drop it to between 60 and 300 seconds before making changes so updates propagate quickly once you act.
  4. Reclaim the resource if it is claimable. If the target is an unclaimed cloud bucket or CDN endpoint, claim it before touching DNS to close the takeover window.
  5. Delete or repoint the record. Remove it if the service is retired. If it must stay active, point it to a resource you currently own and have provisioned.
  6. Validate propagation. Use dig or nslookup to confirm the record resolves correctly and the old destination no longer responds.
  7. Document the change. Record what changed, why, when, and by whom, then update the DNS inventory and assign ongoing ownership.

How to Prevent Subdomain Takeover from Dangling DNS Records

Prevention combines DNS hygiene with continuous monitoring. The controls below carry the most weight for IT teams, security teams, and MSPs managing multiple domains.

  • Remove unused DNS records immediately: delete CNAME, A, AAAA, MX, and TXT records when services retire, rather than leaving them in place just in case
  • Validate third-party targets before pointing at them: confirm cloud, CDN, email, and hosting resources are active and owned by your organization first
  • Monitor email authentication records: review DMARC, SPF, DKIM, MTA-STS, TLS-RPT, and BIMI regularly for inactive or incorrect references
  • Document ownership: keep an inventory of domains, subdomains, senders, and service owners, with a named owner on every record
  • Build DNS cleanup into decommissioning: make record removal a mandatory step whenever a cloud service, SaaS platform, or hosting account is retired
  • Set automated alerts: watch for orphaned services, DNS drift, and new subdomains appearing in your zone
  • Run recurring hygiene audits: monthly or quarterly depending on complexity, and immediately after any migration, provider change, or domain acquisition

What to do with old or unused subdomains

When a subdomain is no longer needed, the decision usually falls into one of five outcomes.

  • Delete the record when the subdomain has no remaining business justification
  • Reclaim the abandoned external resource when the subdomain must stay live and the account is still claimable
  • Park safely by pointing it to a controlled internal resource, never an external platform, when it must resolve but serve nothing
  • Redirect only where a business reason exists, and confirm the destination is owned and active
  • Document every decision and assign ownership before decommissioning anything

How PowerDMARC Helps

PowerDMARC centralizes domain and email authentication monitoring so teams can detect issues across DMARC, SPF, DKIM, MTA-STS, TLS-RPT, and BIMI without reviewing each DNS record by hand. The aim is not finding one dangling record. It is holding continuous visibility over every domain, subdomain, and authentication record that affects your security posture.

  • Centralized dashboard: domain, subdomain, and authentication status viewed from one place
  • Fast issue detection: misconfigurations surfaced before they affect security or deliverability
  • Automated SPF management: fewer lookup failures and cleaner sending sources as SaaS platforms change
  • Compliance readiness: audit preparation support for finance, healthcare, education, retail, and public-sector teams
  • Expert support: global support to help investigate, validate, and remediate a risky record quickly

For service providers, centralized domain grouping and role-based access make it practical to monitor many client environments at once. The MSP and MSSP program is built around that workflow.

If you want a quick read on your current posture, check your domain with the free analyzer. Enter your domain, click “Check now,” and you can view your DNS record configurations, detected misconfigurations, and practical tips to resolve them.

Frequently Asked Questions

These cover the operational questions that come up once the concept is clear.

How do you fix dangling DNS records?

Identify the stale record, verify whether your organization still owns the target, then lower the TTL. Reclaim the resource first if it is claimable, delete or repoint the record, validate propagation with dig, and document the change.

What is a dangling hostname?

A subdomain that resolves to a destination no longer controlled by the domain owner. The dangling DNS record is what creates it. If dev.example.com points to a deprovisioned cloud account, it is a dangling hostname.

Can dangling DNS records affect email security?

Yes. DMARC, SPF, DKIM, MTA-STS, and TLS-RPT records all go dangling when they reference inactive domains, deprecated senders, or unmonitored reporting mailboxes. The result is authentication failures and silent visibility gaps.

How often should organizations audit DNS records?

After every service decommissioning, provider migration, domain acquisition, or sender change. Add recurring monthly or quarterly audits depending on complexity, and continuous monitoring to catch drift between them.

Does a dangling record always mean a subdomain can be taken over?

No. Takeover needs the target resource to be claimable by someone else, which is common with cloud buckets, CDN endpoints, and SaaS subdomains. A record pointing to a dead IP still causes outages and interception risk.

Who should own DNS record cleanup internally?

Whoever owns service decommissioning, not the DNS administrator alone. Records go stale at the moment a service is retired, so cleanup belongs in the offboarding checklist rather than in a separate DNS review.

dangling DNS