How to find all subdomains of a domain
In short
To find a domain's subdomains, combine passive sources (certificate transparency logs, passive DNS and search data, usually through a tool such as Subfinder or Amass) with active checks such as DNS brute-forcing, then resolve every name to see which ones are live. No single method finds everything, so the results have to be merged and repeated over time.
There is no DNS query that lists every subdomain of a domain. DNS answers questions about names you already know, so finding subdomains means collecting candidate names from wherever they leak, then checking which ones exist. Below are the methods that work, roughly in the order I'd use them.
Only run active checks (brute-forcing, zone transfer attempts) against domains you own or are authorized to test. Passive sources are public, but scanning what you find is a different matter.
1. Certificate transparency logs
Every publicly trusted TLS certificate is written to public certificate transparency (CT) logs, and the names on it come along. Since almost every website now has a certificate, CT logs are the single best source. crt.sh lets you search them:
curl -s "https://crt.sh/?q=%25.example.com&output=json" \
| jq -r '.[].name_value' | sed 's/^\*\.//' | sort -u
What you'll miss: names that never had their own certificate (internal names, names covered only by a wildcard certificate) and anything that never served HTTPS.
2. Passive aggregation tools
Tools such as Subfinder and Amass query many passive sources at once: CT logs, passive DNS databases, search engines, web archives and threat intelligence feeds. Some sources need free or paid API keys, and adding them makes a big difference to the results. Running both tools and merging their output finds more than either one alone.
subfinder -d example.com -all -silent | sort -u > subs.txt
3. DNS brute-forcing
Brute-forcing tries likely names (vpn, dev, staging,
mail, api…) and keeps those that resolve. It finds names that never
appeared in any public source. Use a good wordlist and a fast, wildcard-aware resolver tool:
dnsx -d example.com -w wordlist.txt -silent >> subs.txt
Watch out for wildcard DNS: if *.example.com resolves, every guess
"exists". Good tools detect this and filter the results.
4. Zone transfers (rarely, but check)
A misconfigured name server may hand the whole zone to anyone who asks. It's rare today, but the check costs one command per name server:
dig +short ns example.com
dig axfr example.com @ns1.example.com
5. Look at what you already have
- Your own DNS zones and registrar accounts, including ones held by subsidiaries and agencies.
-
Links and redirects on your websites, and the
Subject Alternative Namefield of your certificates. - Mail headers, SPF records and other TXT records, which often name services and hosts.
6. Resolve and clean up the list
A list of names isn't an inventory yet. Resolve every name, keep the IP addresses, and note which ones point to third-party platforms:
dnsx -l subs.txt -a -cname -resp -silent
Resolve from more than one DNS resolver if you can. Load-balanced names return different addresses to different resolvers, and one answer gives you only part of the set. Names that don't resolve are worth keeping in a separate list: a record pointing at a deleted resource is how a subdomain takeover starts.
7. Do it again next week
Subdomains appear constantly, often as shadow IT. A one-off list is out of date within weeks. Run the same process on a schedule and compare the results with the previous run, because the new names are the ones nobody has looked at yet.
This is the part EASMcore automates. Its subdomain discovery runs on every scheduled scan, resolves each name against several resolvers, labels names on shared platforms, and change detection shows which subdomains are new since the last scan.
Frequently asked questions
Can you list all subdomains of a domain with a DNS query?
No. DNS has no "list everything" query for normal use. The exception is a zone transfer (AXFR), which properly configured name servers refuse. Subdomains have to be collected from other sources and then checked one by one.
What is the best free source for finding subdomains?
Certificate transparency logs, searchable through crt.sh. They contain the names on every publicly trusted TLS certificate. Combine them with a passive tool such as Subfinder or Amass for wider coverage.
Is subdomain enumeration legal?
Collecting names from public sources such as certificate transparency logs is generally fine. Active testing, such as DNS brute-forcing or scanning the hosts you find, should only be done on domains you own or are authorized to test.
Why do different tools find different subdomains?
Each tool uses different sources, API keys and wordlists. That's why the usual approach is to run several, merge the results and resolve every name.