How-to guide

How to find all subdomains of a domain

The three ways to discover subdomains, why no method is complete, and how to spot names that can be taken over.

Security teams, IT admins and auditors5 min readUpdated
Short answer

Search certificate transparency logs, which record every public HTTPS certificate and the names on it, then test common names such as www, mail, vpn and dev against DNS. Together they find most subdomains in use. No outside method is complete, because DNS can’t be asked to list every name in a zone.

Why DNS won’t just list them

DNS answers questions about names you already know. There is no standard query for “every name under example.com”. A zone transfer (AXFR) would hand over the whole zone, but properly run nameservers refuse it to anyone outside, so outside discovery means collecting names from other places.

The methods that work

  • Certificate transparency: every certificate a public authority issues is written to public logs, names included. Search a domain in the logs and you see every name that has had a certificate, even short-lived ones.
  • Common names: try the names organisations tend to use, such as www, mail, webmail, vpn, remote, dev, staging, api and portal.
  • DNS records you can already see: MX, SPF includes, CNAMEs and SRV records often name other hosts.
  • Wildcard certificates (*.example.com) hide the individual names, so expect gaps for domains that use them.

What to look for

  • Names nobody recognises: add them to the asset list or remove them.
  • Old staging and test hosts that are still reachable.
  • Dangling CNAMEs: a subdomain that points at a deleted cloud resource. Anyone who claims that resource name can serve content on your subdomain.
  • Expired or soon-to-expire certificates on hosts people still use.
Tip: When you delete a cloud resource, delete its DNS record in the same change. That one habit prevents most subdomain takeovers.

Questions people ask

Can I see every subdomain of any domain?
Not from outside. You can find names that appear in certificate logs, public DNS records and common wordlists. Only the domain’s DNS host has the full list.
Is it legal to look up a domain’s subdomains?
Searching certificate logs and public DNS reads published information. Testing or attacking the hosts you find is a separate matter and needs the owner’s permission.
What is crt.sh?
A popular public search over certificate transparency logs. A subdomain finder queries the same kind of data and then checks which names still resolve.
What is a subdomain takeover?
When a subdomain still points at a cloud service that has been deleted, someone else can create a service with that name and control what the subdomain serves.

Sources and further reading

Written by the middle.network team, who build and run these tools. Last checked 2026-11-21.