Skip to main content
DNSCritical PriorityPro

Subdomain Takeover Test — Check DNS Records for Hijack Risk

Updated November 2026·SecScanner Team

Subdomain takeover occurs when DNS records point to deprovisioned external services that attackers can claim. If a CNAME or A record points to a cloud service, GitHub Pages, Heroku app, or other platform that no longer has your account associated, an attacker can register that resource and serve content from your subdomain.

Results in 1–3 minutes · Free · No signup required

Want the result for your own site? Free DNS Security Checker — paste your domain, get the report.

Why It Matters

Attackers can serve malicious content from your trusted subdomain, steal cookies set for parent and sibling domains, bypass same-origin policy controls, and conduct highly convincing phishing attacks using your brand's domain. A single dangling DNS record can compromise your entire user base.

How We Check

We check CNAME and A records pointing to external platforms and test for unclaimed resource indicators — HTTP 404s with platform-specific error messages, 'NoSuchBucket' responses from S3, GitHub Pages 404 pages, Heroku error pages, and similar signals that indicate the resource is claimable.

Good vs Bad Values

Good and bad values for Subdomain Takeover
ValueVerdictWhy
CNAME to a service you own and that still respondsGoodThe record has a live target in your account. Nothing for an attacker to claim.
CNAME target returns NXDOMAINBadThe destination no longer exists, so anyone who can register that name controls your subdomain.
CNAME to S3 and the page says NoSuchBucketBadThe bucket was deleted. An attacker creates a bucket with the same name and serves content under your domain.
CNAME to github.io and the page says "There isn't a GitHub Pages site here"BadThe Pages site was removed. Another account can claim the custom domain.
CNAME to herokuapp.com and the page says "No such app"BadThe Heroku app name is free to register again.
A record pointing to a released cloud IPBadElastic IPs are recycled; the next customer to receive the address receives your traffic.
NS delegation to nameservers that no longer host the zoneBadA lame delegation lets an attacker create the zone on that provider and answer for the whole subdomain.
Wildcard CNAME (*.example.com) to a third-party serviceWeakEvery unclaimed name under it is potentially takeoverable and hard to inventory.

How to Fix

Remove DNS records for decommissioned services before canceling the associated service accounts. Regularly audit all subdomains for dangling CNAMEs. When deprovisioning cloud resources, always remove the DNS record first — then delete the cloud resource. Use a subdomain inventory spreadsheet or automated monitoring to catch new risks.

The fix lives in DNS, not in the web server, so there is no Nginx or Apache directive. Work through your zone like this:

  1. Export all records (dig example.com AXFR if allowed, or copy from the DNS dashboard).

  2. For each CNAME, confirm the target still resolves and the account behind it is yours.

dig +short CNAME promo.example.com
dig +short promo.example.com            # empty or NXDOMAIN means dangling
curl -sI https://promo.example.com | head -1
  1. Delete records whose service is gone. Cloudflare: DNS → Records → delete the entry. AWS Route 53: remove the record before deleting the bucket, CloudFront distribution or Elastic IP.

  2. Turn on provider verification: add a verified domain in your GitHub organisation settings for Pages, and use the asuid TXT record for Azure App Service.

Common Mistakes

  • Cancelling the SaaS account or deleting the cloud resource before removing the DNS record. Always delete the record first.
  • Auditing only the main DNS provider. Marketing tools, old registrars and delegated zones often hold forgotten records.
  • Treating a 404 as harmless. On many platforms the exact 404 text is how attackers identify a claimable resource.
  • Skipping domain verification. GitHub, Azure and others offer a verified-domain or `asuid` TXT mechanism that stops others from claiming your name.

Frequently Asked Questions

What is subdomain takeover?

Subdomain takeover is an attack where an attacker claims an external service (GitHub Pages, Heroku, S3, etc.) that your DNS record points to but is no longer provisioned by you. Once they control the service, they can serve content on your subdomain, steal cookies, and run phishing campaigns from your trusted domain.

How do I test my domain for subdomain takeover vulnerabilities?

Enter your domain in SecScanner's free subdomain takeover test above. We check CNAME records for dangling pointers to cloud platforms and detect platform-specific error responses that indicate an unclaimed resource. For manual testing, run `dig CNAME sub.yourdomain.com` and check whether the pointed service is still provisioned.

Which services are most commonly exploited for subdomain takeover?

The most common platforms are: GitHub Pages (custom domain not claimed), Heroku (app deleted but CNAME remains), AWS S3 (bucket deleted), Azure (app service removed), Fastly, Shopify, Zendesk, and Tumblr. Any service that uses CNAMEs and allows claiming custom domains is a potential target.

How do I prevent subdomain takeover?

Always remove DNS records before deprovisioning the associated cloud resource — never in the other order. Maintain an inventory of all subdomains and their associated services. Set up automated monitoring (like SecScanner's continuous monitoring) to alert you when a subdomain shows takeover indicators.

Can subdomain takeover steal cookies?

Yes — if cookies are set with Domain=.yourdomain.com (parent domain), they're sent to all subdomains including a taken-over one. This enables session hijacking. Additionally, an attacker-controlled subdomain can set cookies for parent and sibling domains, poisoning sessions across your entire site.

What is a dangling DNS record?

A dangling DNS record (also called an orphaned or stale DNS record) is a CNAME or A record that still exists in your DNS but points to an external resource that no longer belongs to you. These are the root cause of subdomain takeover vulnerabilities.

Related Security Checks

Related Tool

DNS Security Checker

Run all 6 related checks with our free dns security checker

Check Your Website Now

Run a free security scan to check for Subdomain Takeover issues and 61 other security checks.

Scan Your Website Free