← All articles

Free Subdomain Takeover Checker: Find Dangling DNS Records

Subdomain takeover is one of the most reliable bugs in bug bounty work, and a big reason is that the root cause lives outside the application. Nobody wrote vulnerable code. Someone deleted a Heroku app, an S3 website bucket or an Azure App Service and forgot the DNS record pointing at it. This post explains how dangling DNS records become takeovers, which services are affected, how to check your own domains with dig, and how our free-to-try Subdomain Takeover checker automates the process.

What a subdomain takeover actually is

The can-i-take-over-xyz project, the community reference most researchers use, describes it this way: a takeover happens when a subdomain points to a service, such as GitHub Pages or Heroku, that has been removed or deleted. An attacker then creates a resource on the same service and claims your hostname.

Microsoft's Azure guidance walks through the usual lifecycle:

  1. Creation. You deploy app-contoso-dev.azurewebsites.net and add a CNAME greatapp.contoso.com → app-contoso-dev.azurewebsites.net.
  2. Deprovisioning. The app is deleted, but the CNAME stays. You now have a dangling DNS record.
  3. Takeover. An attacker provisions a resource with the same name on the same provider, and traffic for greatapp.contoso.com now reaches their content.

MDN describes a second variant that gets less attention. During provisioning, if you create the DNS record before you claim the virtual host, someone faster can claim it first.

Why it matters more than "someone can host a page"

A defaced marketing subdomain is embarrassing. The real impact comes from how browsers and your own app trust subdomains:

  • Cookie theft. Session cookies scoped to .example.com are sent to every subdomain. Both MDN and Microsoft call out cookie harvesting as a direct consequence, and Microsoft notes that TLS certificates don't prevent it.
  • XSS and CSP bypass. If your CSP or CORS policy allows *.example.com, a hijacked subdomain counts as trusted origin code. MDN lists both cross-site scripting and circumventing content security policies as possible outcomes.
  • Phishing on your real domain. A login page on sso-old.example.com passes every "check the URL" training your staff has had.
  • OAuth and redirect abuse. Allow-listed redirect URIs on a dead subdomain can turn into token theft.

Which services are vulnerable?

Not every dangling CNAME can be exploited. Whether it can depends on whether the provider lets a different account claim your hostname without proving it owns the domain. can-i-take-over-xyz tracks this service by service. Here's a sample of entries from the list at the time of writing:

ServiceStatus in can-i-take-over-xyzFingerprint
AWS S3VulnerableThe specified bucket does not exist
AWS Elastic BeanstalkVulnerableNXDOMAIN
Microsoft Azure (azurewebsites.net, cloudapp.net, blob.core.windows.net and others)VulnerableNXDOMAIN
BitbucketVulnerableRepository not found
GhostVulnerableSite unavailable
Surge.shVulnerableproject not found
PantheonVulnerable404 error unknown site!
GitHub PagesEdge caseThere isn't a GitHub Pages site here.
HerokuEdge caseNo such app
NetlifyEdge caseNot Found - Request ID:
ShopifyEdge caseSorry, this shop is currently unavailable.
AWS CloudFrontNot vulnerableViewerCertificateException
FastlyNot vulnerableFastly error: unknown domain:
ZendeskNot vulnerableHelp Center Closed

Two caveats. First, statuses change as providers add domain verification, and the project itself carries a disclaimer that it doesn't guarantee accuracy. Check the current list and the linked issue for a service before deciding anything. Second, "Not vulnerable" doesn't mean you should keep the record. A dangling CNAME is still a hygiene finding, and the project notes that some bug bounty programs accept dangling DNS reports without proof of compromise.

How to check manually with dig

You'll need a list of your subdomains and a terminal. Everything below is read-only DNS and HTTP lookups.

Step 1: Build a subdomain inventory

Start with your DNS provider's zone export, because that's the source of truth. Then add what the public can see. Certificate Transparency logs are a good source:

curl -s "https://crt.sh/?q=%25.example.com&output=json" \
  | jq -r '.[].name_value' | tr 'A-Z' 'a-z' | sort -u > subdomains.txt

Entries starting with *. are wildcard certificates. Remove them or check them separately.

Step 2: Resolve CNAMEs

dig +short CNAME blog.example.com

If this returns something like example-blog.herokuapp.com. or oldsite.s3-website-us-east-1.amazonaws.com., follow the chain:

dig blog.example.com

Check the status: field in the header section of the output:

  • status: NOERROR with answers: the record resolves. Move on to the HTTP check.
  • status: NXDOMAIN: the name, or its CNAME target, doesn't exist. For providers whose fingerprint is NXDOMAIN (Elastic Beanstalk, Azure, Discourse), this is the strongest signal of a takeover candidate.
  • status: SERVFAIL: often a broken delegation, which is worth investigating (see step 4).

To run this across the whole inventory:

while read -r sub; do
  target=$(dig +short CNAME "$sub" | head -n1)
  [ -z "$target" ] && continue
  status=$(dig "$sub" | grep -o 'status: [A-Z]*' | cut -d' ' -f2)
  echo "$sub -> $target [$status]"
done < subdomains.txt

Step 3: Fetch the page and match fingerprints

For CNAMEs that resolve, the provider usually serves a recognisable error page when the backing resource is gone:

curl -s -m 10 https://blog.example.com/ | grep -iE \
  "no such app|the specified bucket does not exist|repository not found|there isn't a github pages site here|project not found"

A match means the CNAME points at a provider that no longer has your resource. Compare the provider's entry in can-i-take-over-xyz to decide severity. If HTTPS fails because of a certificate mismatch, try http:// as well, since many dangling records only answer on port 80.

Step 4: Don't forget NS and MX records

CNAMEs get most of the attention, but delegated zones can dangle too. If a subdomain is delegated to a DNS provider where the hosted zone was deleted, someone may be able to recreate it. Patrik Hudak's write-up on NS takeovers covers this in depth.

dig +short NS dev.example.com
dig @<one-of-those-nameservers> dev.example.com SOA

A SERVFAIL or REFUSED from the delegated nameservers is the warning sign. Do the same for MX records that point to mail services you've cancelled.

Step 5: Stop there

Don't try to claim the resource on a domain you don't own, and think twice even on your own production domain. If you're testing within a bug bounty scope, can-i-take-over-xyz recommends serving a harmless HTML comment at a random path, never on the index page. Our bug bounty program directory lists program scopes if you do this professionally.

Automating it: the Subdomain Takeover checker

Doing this by hand works for a dozen subdomains. It breaks down when marketing spins up landing pages every month and engineering tears down preview environments every week. The SecurityInfinity Subdomain Takeover checker uses SecurityInfinity's autonomous recon agents to work through the same steps for your verified domain: finding subdomains, following their DNS records and flagging ones that look like takeover candidates, so you aren't repeating the dig loop by hand every week.

Every scan is read-only, and it only runs against domains you've verified through a DNS TXT record or a matching work email. We don't claim resources or attempt exploitation.

You can try it with the free Starter plan: 100 credits and one verified domain, with no card required. Pro ($9/month) adds continuous monitoring and re-scans. That matters here because dangling records appear the day something is deprovisioned, not on the day of your annual pentest. See pricing for details. If you're running a broader review, combine it with the SSL integrity check and the deep security scan.

Remediation: fixing and preventing dangling DNS

Fix the finding. Delete the DNS record, or re-claim the resource on the provider if you still need the subdomain. MDN's advice for a subdomain that's already been taken over is the same: cut the DNS record first, then examine each layer (CDN, hosting) to find where the attacker registered their claim.

Change the order of operations. MDN's rule is simple. When provisioning, claim the virtual host first and create DNS records last. When deprovisioning, remove DNS records first. Put that rule in your runbooks and your Terraform module order.

Use provider-side domain verification. Most major platforms now support it:

  • GitHub Pages. Verify your custom domain at the account or organization level. This stops other GitHub users from publishing to it and covers immediate subdomains. GitHub also warns against wildcard DNS records, which remain a takeover risk even after verification.
  • Azure App Service. Create the asuid.{subdomain} TXT record with your domain verification ID. Microsoft documents that this stops other subscriptions from validating the custom domain. Azure DNS alias records, which tie a record's lifecycle to the resource, and Microsoft Defender for App Service's dangling DNS detection are also options.

Avoid wildcard CNAMEs to third-party services. A *.example.com record pointed at a SaaS provider turns every unclaimed name into a potential takeover.

Keep an inventory and monitor it. Microsoft and MDN both recommend maintaining a list of every domain and the provider behind it. Automated continuous scanning fills the gap between "we have an inventory" and "the inventory is accurate".

Get a report your customers will accept

Dangling DNS often turns up in enterprise security reviews and SOC 2 pentest scopes, because it's easy for an outside tester to find. If you need a formal deliverable, our engineer-delivered external pentest ($499) includes engineer-verified findings, evidence and fixes, OWASP Top 10 mapping and a free retest.

To see where you stand today, verify your domain and start a scan with the Subdomain Takeover checker.

Frequently asked questions

What is a dangling DNS record?

It's a DNS record, usually a CNAME, that points to a resource that no longer exists, such as a deleted Heroku app, S3 bucket or Azure App Service. If the provider lets another account create a resource with the same name, an attacker can claim the hostname and serve content on your subdomain.

How do I check for a subdomain takeover manually?

Resolve each subdomain with dig +short CNAME to find third-party targets, then check whether the target returns NXDOMAIN or a provider error page such as "No such app" or "The specified bucket does not exist". Compare the provider against the can-i-take-over-xyz list to see whether it's exploitable.

Is every dangling CNAME exploitable?

No. Providers like CloudFront, Fastly and Zendesk are listed as not vulnerable in can-i-take-over-xyz because they block cross-account claims, and others are edge cases. You should still remove dangling records, since they're clear evidence of poor DNS hygiene and provider behaviour can change.

Does HTTPS protect against subdomain takeover?

No. Once an attacker controls the subdomain, they can often get a valid certificate for it, and Microsoft's guidance explicitly says SSL certificates don't protect your users' cookies from a takeover. The fix is removing or reclaiming the DNS record.

Is the SecurityInfinity Subdomain Takeover checker free?

You can try it with the free Starter plan's 100 credits on one verified domain, with no card required. Continuous monitoring and re-scans, which catch new dangling records as they appear, are on Pro at $9/month or $90/year.

Find what attackers can see, before they do.

AI pentesting agents test your web app, API and cloud, and every finding comes with evidence and a fix. First report in about 10 minutes.

Stay ahead of attackers.

New vulnerabilities, breach write-ups and practical fixes. A few emails a month.