pentesting, updated
dnsrecon
dnsrecon: DNS enumeration and zone/record sweeps, used to spot dangling records for subdomain takeover.
What it’s for
Enumerate DNS records for a domain and check for weaknesses such as zone transfer and dangling CNAMEs that enable subdomain takeover.
Options
Target and resolver
| Flag | Effect |
|---|---|
-d example.com | Target domain |
-n ns1.example.com | Query a specific nameserver |
-r 10.0.0.0/24 | Reverse-lookup a range (with -t rvl/-t rvs) |
Scan type (-t)
| Value | Effect |
|---|---|
std | Standard records: SOA, NS, A, AAAA, MX, SRV, TXT |
axfr | Attempt a zone transfer against every NS |
brt | Brute-force hostnames from a wordlist |
rvl | Reverse lookup of an IP range |
srv | Enumerate common SRV records |
zonewalk | Walk a DNSSEC-signed zone (NSEC) |
Brute force and output
| Flag | Effect |
|---|---|
-D subs.txt | Wordlist for brt |
-f | Filter out wildcard answers while brute forcing |
--threads N | Parallel lookups |
-x out.xml | Save results as XML |
-j out.json | Save results as JSON |
-c out.csv | Save results as CSV |
Examples
Standard enumeration
dnsrecon -d example.com # SOA, NS, A/AAAA, MX, SRV, TXT
dnsrecon -d example.com -n 1.1.1.1 # force a specific resolver
dnsrecon -d example.com -t std -j out.json # standard sweep saved as JSON
Zone transfer — always try first
dnsrecon -d example.com -t axfr # test AXFR on every nameserver
Brute forcing and reverse lookups
dnsrecon -d example.com -t brt -D subs.txt -f # brute hostnames, drop wildcards
dnsrecon -d example.com -t brt -D subs.txt --threads 20 # more threads for large lists
dnsrecon -r 203.0.113.0/24 -t rvl # reverse-lookup a network block
dnsrecon -d example.com -t zonewalk # enumerate an NSEC-signed zone
References
- dnsrecon on GitHub
- A successful
axfrhands you the whole zone at once — still common on misconfigured secondaries.