- No single source finds every subdomain. Combine certificate-transparency logs, passive DNS, archives and your own zone data, then add active guessing.
- A name only matters once you know where it resolves and what answers there.
- The list starts going stale the day you finish it, so repeat the process and compare runs.
- Only run the active steps against domains you own or are authorized to test.
Why the subdomain list comes first
Every later step of attack surface work depends on names. You can’t scan a host you don’t know about, renew a certificate you have never seen, or remove a DNS record nobody remembers creating. Attackers know this, which is why enumeration is the first thing they do.
There is also no single authoritative list. Your DNS provider knows the records in the zones it hosts, but not names delegated elsewhere, names managed by vendors, or names under domains you forgot you owned. The practical approach is to combine several sources, then verify what you found. The six steps below go from the cheapest, quietest sources to the active ones.
Step 1: List the domains you own
Start one level up. Collect every registered domain: the main brand, country domains, old brands, product names, acquired companies, and domains an agency registered on your behalf. Registrar accounts and invoices are the best source; WHOIS and reverse WHOIS lookups can fill gaps where privacy rules allow. If you can export your DNS zones, do it: that is the most accurate list of the names you serve today.
While you are there, check whether your name servers hand the whole zone to anyone who asks:
dig +short NS example.com
dig AXFR example.com @ns1.example.comA refused transfer is the correct result. If you get the full zone back, you have just found a finding, and so can anyone else.
Step 2: Search certificate transparency
Since 2018, Chrome and Apple platforms have required publicly trusted TLS certificates to be recorded in certificate-transparency (CT) logs, which are public and append-only. In practice, every public certificate issued for one of your names is listed there with the names it covers. Public search sites such as crt.sh let you query the logs by domain:
curl -s "https://crt.sh/?q=%25.example.com&output=json" \
| jq -r '.[].name_value' | sed 's/^\*\.//' | sort -uCT logs are the richest single source, with three limits to keep in mind:
- Wildcard certificates (
*.example.com) hide the individual names they cover. - Hosts that never had a public certificate (internal names, plain-HTTP services, certificates from a private authority) don’t appear at all.
- Logs keep expired certificates, so some names will no longer exist. That is useful history; step 5 sorts them out.
Step 3: Add passive DNS and archives
Passive DNS datasets are built from DNS answers observed over time by resolvers and sensors. They show names that resolved at some point, including names that never had a certificate, often with the dates they were first and last seen. Several providers offer lookups with rate limits and paid APIs for volume. Then add:
- Search engines: a query such as
site:example.com -site:www.example.comsurfaces indexed subdomains other than the main site. - Web archives: the Internet Archive’s Wayback Machine keeps a URL index you can query by domain, and old URLs reveal hosts that have since moved or closed.
- Your own content: links in your pages, JavaScript bundles, Content Security Policy headers and mobile apps often name API and asset hosts.
- Records you already have: MX, SPF and other TXT records name the mail providers and services that act on your behalf.
Open-source enumeration tools query dozens of these sources in one run and merge the results. They are worth using; just remember that each tool can only report what its sources have seen.
Step 4: Brute-force and permute names
Passive sources miss names that were never published anywhere. Active enumeration guesses them:
- Wordlist brute force: try common labels such as dev, staging, test, vpn, mail, api, admin and portal against each domain.
- Permutations: build variants of names you already found, such as api-dev, dev-api, api2 or eu-api.
- Recursion: repeat for each new level, for example
dev.api.example.com.
while read -r label; do
ip=$(dig +short A "$label.example.com" | head -n1)
[ -n "$ip" ] && echo "$label.example.com $ip"
done < labels.txtThis sends many DNS queries about your domain, so use reliable resolvers, keep the rate modest, and expect diminishing returns: a short, well-chosen wordlist plus permutations of known names usually finds more than a huge generic list.
Step 5: Resolve and filter wildcards
Now resolve every candidate and record what it points to: A and AAAA addresses, CNAME targets, or nothing at all. Names that no longer resolve go on a historical list. CNAMEs that point at third-party services deserve a closer look, because a target that no longer exists can be claimed by someone else; the subdomain takeover guide explains how to check them.
Wildcard DNS can make every guess look real: if *.example.com has a record, any random label resolves. Test for it with a name that cannot exist:
dig +short A "$(openssl rand -hex 8).example.com"If that returns an address, note the wildcard answer and drop results that match it, or compare HTTP responses instead of DNS answers for that zone. Content delivery networks add a twist, since one name can return different addresses from one query to the next.
Step 6: Probe, screenshot, deduplicate
A name that resolves is not yet an asset you understand. For each one:
- Probe HTTP and HTTPS, plus common alternate ports such as 8080 and 8443: status code, page title, redirect target, server and technologies.
- Take a screenshot, so a person can tell a login page from a parked page in seconds.
- Read the certificate: the names it covers, the issuer and the expiry date.
- Deduplicate. Many names lead to the same application through redirects or a shared load balancer; group them so each application is reviewed once.
curl -s -o /dev/null -w "%{http_code} %{redirect_url}\n" --max-time 5 https://dev.example.comChaining the steps
Put together, the process is a pipeline in which each stage feeds the next:
- Root domains from registrar accounts and zone exports.
- Candidate names from CT logs, passive DNS, archives and your own content.
- Extra candidates from brute force and permutations.
- Resolved names, with wildcard answers removed.
- Live hosts with titles, technologies, certificates and screenshots.
- A deduplicated inventory with the date each asset was first seen.
Open-source tools exist for every stage (passive enumerators, mass resolvers, HTTP probers, screenshot tools), and most read a list from standard input and write one to standard output, so they chain with a pipe. Keep the raw output of each stage: when a result looks wrong, you will want to see where it came from.
Why a one-off list goes stale
A subdomain inventory decays quickly. Developers create preview environments, marketing launches campaign sites, vendors add service names and certificates are reissued with new names, usually without telling the security team. Old names disappear too, sometimes leaving dangling records behind.
So treat enumeration as a schedule, not a project: run it weekly or more often, store each result with a date, and review the difference between two runs. “Three new names since last week” is a task a person can finish; “here are 2,400 names” is not.
Only scan what you own
Looking names up in public sources such as CT logs and passive DNS sends nothing to the target. Brute force, port scanning and HTTP probing are different: they send traffic to infrastructure that may belong to a hosting provider or a vendor. Run the active steps only against domains you own or have written authorization to test, follow your providers’ testing policies, and keep rates low enough not to disrupt anything.
How Scanbe4 does it
Scanbe4 automates the passive part of this process, and the validation that follows, for each domain you monitor:
- Subdomains from passive sources, including certificate-transparency logs and passive DNS datasets, merged and deduplicated.
- DNS resolution of every name: A, AAAA, CNAME, MX, TXT, NS and SOA records.
- HTTP probing of every name with status, title, web server, technologies and CDN, and the top 1,000 TCP ports on each resolved IP address.
- A screenshot of every live web app in a full scan, and a check of web hosts for takeover-prone dangling records.
If you would rather not maintain this pipeline yourself, request a demo and we will run it on one of your domains with you.
- External attack surface management — subdomains, hosts, ports and certificates per domain
- Scans documentation — full and quick scans, schedules and the live scan page
- Adding domains — which targets you can add and how approval works
- Your attack surface is bigger than you think — what to do with the list once you have it
Filed under Attack surface · DNS