Information Gathering
Learn how to use Subfinder in this beginner tutorial, from installing ProjectDiscovery's passive subdomain tool to running and reading your first authorised scan. Add API keys for wider coverage, save clean results, and chain Subfinder into httpx to validate live web hosts before further testing.
sudo apt install subfinder
subfinder -d <domain> [options]
Learning how to use Subfinder is easiest as a repeatable beginner loop: install it with `sudo apt install subfinder` on Kali or `go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest`, verify the binary with `subfinder -version`, and run `subfinder -d example.com` as your first scan on a domain you are authorised to test. Next, add provider API keys in `~/.config/subfinder/provider-config.yaml`, save clean findings with `subfinder -d example.com -silent -o results.txt`, and validate web endpoints with `subfinder -d example.com -silent | httpx -title -status-code` before deeper testing.
Run `subfinder -d example.com -silent`. The sample below is illustrative: api.example.com mail.example.com dev.example.com blog.example.com staging.example.com Subfinder prints one candidate hostname per line: the leftmost label hints at a possible role — api for an API, mail for mail, dev and staging for non-production systems — but a name alone proves nothing about what actually runs there. The `-silent` flag strips the banner and status messages, leaving clean lines you can save or pipe. Because the names come from public datasets, the list can include stale entries that no longer resolve, so validate them with httpx before any authorised follow-up.
The Subfinder tool is a fast, passive subdomain enumeration tool created by ProjectDiscovery. Its single job is to discover as many valid subdomains of a target domain as possible — such as mail.example.com, api.example.com, and dev.example.com — by pulling together information that is already public on the internet. Because it never queries the target directly, Subfinder is one of the safest and stealthiest ways to begin reconnaissance.
Subfinder was created to solve a very common problem in cybersecurity: before you can test or defend a website, you first need to know every place it lives online. Large organisations often run hundreds of subdomains, and many are forgotten, misconfigured, or left exposed. Subfinder gathers these subdomains from Certificate Transparency logs, passive DNS providers, search engines, and threat-intelligence APIs, then merges everything into one clean, de-duplicated list.
The tool is written in Go, which is why it is so fast: it can query dozens of data sources at the same time and return results in seconds. Distribution is a single self-contained binary, so it runs identically on Kali Linux, Ubuntu, Debian, macOS, and Windows with no messy dependencies. This simplicity is a big reason Subfinder has become a default choice for beginners and professionals alike.
Subfinder is best known in the bug bounty and penetration testing communities, where passive subdomain discovery is the essential first step of attack-surface mapping. It is also widely used for OSINT investigations, external asset monitoring, and defensive security, where blue teams run it against their own domains to spot shadow IT and unexpected exposures before attackers do.
One of Subfinder's greatest strengths is how well it plays with other tools. Its output is designed to be piped directly into ProjectDiscovery's httpx to find live hosts and nuclei to scan them for vulnerabilities. This makes Subfinder the foundation of a modern, automated reconnaissance pipeline rather than just a standalone utility.
| Command | Purpose |
|---|---|
subfinder -d <authorized-domain> | Enumerate subdomains for one domain. |
subfinder -d <authorized-domain> -all | Use all configured passive sources. |
subfinder -dL <authorized-domains.txt> -o <subdomains.txt> | Enumerate a domain list and save results. |
subfinder -d <authorized-domain> -s crtsh,github -silent | Restrict enumeration to selected sources; GitHub requires provider credentials. |
subfinder -d <authorized-domain> -recursive -silent | Use sources that support recursive enumeration. |
subfinder -d <authorized-domain> -oJ -cs -o <subdomains.jsonl> | Write JSONL results with source attribution. |
subfinder -d example.comBasic passive subdomain discovery for a single target domainsubfinder -d example.com -allUse every configured passive source for maximum subdomain coveragesubfinder -d example.com -o results.txtSave every discovered subdomain to a plain text output filesubfinder -dL domains.txt -o all-subs.txtEnumerate subdomains for many root domains listed in a filesubfinder -d example.com -silentSilent mode: print only subdomains, no banner or status linessubfinder -d example.com -json -o subs.jsonStructured JSON output with the source that found each subdomainsubfinder -d example.com -silent | httpx -title -status-codePipe live hosts straight into httpx for HTTP probingsubfinder -d example.com -o subdomains.txtPassive subdomain enumerationsubfinder -d example.com -all -o all-subs.txtUse all sourcessubfinder -d example.com -recursiveRecursive enumerationsubfinder -d example.com -timeout 3030-second timeoutsubfinder -d example.com -provider githubUse GitHub providersubfinder -d example.com -t 2020 concurrent threadssubfinder -d example.com -o results.json -jsonJSON outputsubfinder -l domains.txt -all -o combined.txtMultiple domains from filesubfinder -d example.com -config config.yamlCustom config filesubfinder -d example.com -max-time 10Max 10 minutes runtimesubfinder -d example.com -recursive -t 10 -o deep.txtDeep recursive with 10 threadsMap a program's full attack surface passively and safely before hunting for vulnerabilities within scope.
Gather an organisation's public subdomains from certificate logs and passive DNS for open-source intelligence.
Run Subfinder as the first recon step to build a target list for deeper scanning and enumeration.
Reveal forgotten staging, dev, and admin hosts that expand an organisation's real attack surface.
Track newly created subdomains over time to detect shadow IT and unexpected internet exposure.
Surface cloud-hosted subdomains and endpoints that public data sources have already recorded.
Feed discovered subdomains into httpx and nuclei to assess the security of every live web asset.
Study infrastructure and passive DNS relationships for threat intelligence and academic research.
| Feature | Subfinder | Amass | Assetfinder |
|---|---|---|---|
| Speed | Very fast | Slower (thorough) | Fast |
| Passive Sources | Dozens (with API keys) | Many + active | Several |
| Active Brute-force | No (passive only) | Yes (optional) | No |
| Config Complexity | Low (one YAML) | Higher (config file) | Very low |
| Output Formats | TXT/JSON | TXT/JSON/DB | TXT |
| Best For | Fast day-to-day passive recon | Deep, exhaustive mapping | Quick one-off lookups |
| Feature | Passive (Subfinder) | Active (DNS brute-force) | Certificate Transparency |
|---|---|---|---|
| Touches Target DNS | No — queries third-party sources | Yes — resolves guessed names | No — reads public CT logs |
| Detection Risk | Very low | Higher (query volume) | Very low |
| Finds Unpublished Hosts | Only if a source knows them | Yes (if guessable) | Only if a cert was issued |
| Typical Tool | subfinder -all | dnsenum / gobuster dns | subfinder (crtsh source) |
| When To Use | First, stealthy pass | When passive is exhausted | Always — cheap coverage |
| Feature | Goal | Flag | Pipes Into |
|---|---|---|---|
| Human-readable list | Quick review | -o subs.txt | Manual triage |
| Machine-readable | Automation | -oJ -o subs.json | jq / scripts |
| Live-host probing | Find live web hosts | -silent | httpx | httpx |
| Vulnerability scan | Find issues | -silent | httpx | nuclei | nuclei |
| Max coverage | Every source | -all -recursive | dedupe + resolve |
Run 'subfinder -d example.com' for a basic passive scan. Add '-all' to query every configured source, '-o results.txt' to save output, and '-json' for structured JSON with source attribution. Pipe results into httpx for live-host validation: 'subfinder -d example.com -silent | httpx'.
The -d flag specifies the target domain: 'subfinder -d example.com'. The -o flag writes results to a file: 'subfinder -d example.com -o results.txt'. Use -dL instead of -d to read multiple domains from a text file.
Very accurate for subdomains recorded in public sources. Results may include stale subdomains that no longer resolve, so pipe output into httpx to validate which ones are live.
Plain text by default (one subdomain per line). Use -json for structured output that includes the source that found each subdomain. Use -silent to suppress the banner for clean piping.
Yes, Subfinder is a staple of bug bounty reconnaissance. Hunters use it as the first step to map a program's attack surface, because passive enumeration stays within scope and does not trigger security alerts.
Download from GitHub: 'github.com/projectdiscovery/subfinder/releases' has prebuilt binaries for Linux, macOS, and Windows. Or install via package managers: 'sudo apt install subfinder' (Kali/Debian), 'brew install subfinder' (macOS), or 'go install' from source.
Information Gathering
OWASP Amass is the industry-standard in-depth network mapping and attack surface discovery tool. It uses active and passive techniques, scraping 20+ public data feeds, DNS enumeration, and certificate transparency logs to discover subdomains, IP addresses, and ASN data — making it essential for penetration testing, bug bounty hunting, and enterprise security assessments.
Information Gathering
DNSenum is a multithreaded Perl script for DNS enumeration that discovers DNS records, attempts zone transfers, brute-forces subdomains, and performs reverse lookups. It is a foundational reconnaissance tool in Kali Linux for mapping a target domain's DNS infrastructure.
Information Gathering
dig (domain information groper) is a flexible tool for interrogating DNS name servers. It performs DNS lookups and displays the answers that are returned from the name server(s).
Information Gathering
Fierce is a PERL script that quickly inspects a target domain for non-contiguous IP space and hosts by combining brute force testing, reverse lookup mapping, and wildcard tracking.
Information Gathering
DNSRecon provides the ability to check NS records, MX records, zone transfers, SRV records, and cache snooping capabilities within a comprehensive Python network inspection script environment.
Information Gathering
Learn how to use theHarvester in Kali Linux: gather emails, subdomains, employee names, open ports, and banners from public sources with a step-by-step first scan, API keys, and worked examples for authorized OSINT recon.
Learn to map external attack surfaces using OSINT tools. Master subdomain discovery, service enumeration, and asset inventory for penetration testing and bug bounty hunting.
OSINT · IntermediateLearn a complete reconnaissance workflow combining OSINT, DNS enumeration, subdomain discovery, and active scanning for comprehensive target profiling.
OSINT · IntermediateMaster subdomain enumeration techniques using passive and active methods to discover hidden subdomains and expand attack surface mapping.
OSINT · IntermediateLearn how to do DNS enumeration step by step with dig, nslookup, dnsrecon and gobuster — a worked example, tool comparison and cheat sheet.
Run 'subfinder -d example.com -silent'. An illustrative result could be:
api.example.com
mail.example.com
dev.example.com
blog.example.com
staging.example.com
Each line is one candidate fully qualified domain name gathered from passive sources. 'api.example.com' suggests an API host, 'mail.example.com' a mail-related host, 'dev.example.com' a development host, 'blog.example.com' a content host, and 'staging.example.com' a pre-production host; those labels suggest possible roles but do not prove which services run there. During this passive run, Subfinder does not contact the listed hosts, and a line does not indicate reachability, an open port, or a vulnerability. The '-silent' flag removes the banner and status messages, leaving clean lines that scripts and pipes can consume. For source attribution, run 'subfinder -d example.com -json'; its JSONL output can include one object per finding, such as '{"host":"api.example.com","input":"example.com","source":"crtsh"}'. The 'source' value identifies the passive provider that returned the name, which helps you audit coverage. Passive records can be old, parked, wildcard-derived, or no longer resolve, so discovery is not proof that a host is live. Validate web endpoints with 'subfinder -d example.com -silent | httpx -title -status-code' and review the results before authorised follow-up. Because '-silent' emits only hostnames, it is the preferred mode for piping to httpx or saving reusable lists.This tool is designed for authorized security testing, educational purposes, and legitimate network administration only. Unauthorized access to computer systems is illegal.