Overview
Subfinder is a passive subdomain-enumeration tool from ProjectDiscovery. It aggregates results from supported public sources and is designed to fit into repeatable reconnaissance workflows without making active probes the default.
Key features
Passive subdomain discovery; configurable data sources; JSON output; pipeline-friendly CLI.
Install & first run
# Go
go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest
export PATH="$PATH:$(go env GOPATH)/bin"
# Docker
docker run --rm projectdiscovery/subfinder:latest -d example.com
# Passive subdomains only, one per line
subfinder -d example.com -silent
# Use every source and save the result
subfinder -d example.com -all -o example-subs.txt
# Feed straight into httpx to find live web services
subfinder -d example.com -silent | httpx -silent
Optional API keys go in ~/.config/subfinder/provider-config.yaml and add sources that need them. Docs: https://docs.projectdiscovery.io/tools/subfinder/overview
Real-world example
Use Subfinder to discover known public subdomains for a domain in scope, then validate and prioritize the results before testing.
Common questions
Does Subfinder need API keys?
Some data sources require provider keys. Check the official installation guide for current requirements.
Passive only - is that enough?
It finds names that already appear somewhere public: certificates, DNS datasets, search indexes. Names that were never published need brute forcing, which is a different tool.
How do I add API keys?
Put them in ~/.config/subfinder/provider-config.yaml. Sources without keys still work; keys mostly unlock more coverage and speed.
Why is a subdomain missing?
No single source sees everything. Add -all, add keys, and accept that passive enumeration is a starting list, not an inventory.
Related tools
dnsx
Resolve and inspect DNS records at scale in a pipeline: A/AAAA/CNAME lookups, wildcard filtering and custom resolvers. Free, open source, Go.
httpx
Turn a host list into live HTTP services: status codes, titles, TLS details, headers and detected tech in one fast pass. Free, Go CLI.
Katana
Crawl web applications for URLs and endpoints, parsing JavaScript and known files so you see the routes a user can really reach. Free, Go CLI.
Related reading: OWASP Amass vs Subfinder: Subdomain Recon Comparison
Keep exploring: browse every assessment phase in the Pentest Hub.
Authorized testing only — only ever test systems you own or have explicit written permission to assess.
