Default Port: 53 (TCP and UDP)
DNS is often treated as background infrastructure, but it’s one of the richest sources of passive recon on an engagement: subdomains, internal hostnames, mail servers, and occasionally entire zone files, all reachable without touching the actual target application. A surprising number of DNS servers are still misconfigured in ways that hand over far more than they should.
Standard Queries
Asking a resolver for specific records, one at a time. Normal, expected DNS traffic that any client generates.
Zone Transfer (AXFR)
Requesting the entire zone file in one go, meant only for secondary nameservers. When misconfigured to allow anyone, it leaks the whole internal DNS map at once.
DNS Record Types
Knowing what each record type actually represents is what turns a wall ofdig output into useful intelligence rather than noise.
| Record | Description |
|---|---|
A | Maps a hostname to an IPv4 address |
AAAA | Maps a hostname to an IPv6 address |
CNAME | Alias pointing one hostname to another |
MX | Mail server(s) responsible for the domain |
NS | Authoritative nameservers for the domain |
TXT | Free-form text, often SPF/DKIM records or domain verification strings |
SOA | Authority info: primary nameserver, admin contact, zone serial number |
PTR | Reverse mapping from an IP address back to a hostname |
SRV | Service location records, e.g. pointing to AD domain controllers |
Basic Lookups
dig becomes genuinely useful rather than just a fancier host:
Zone Transfers (AXFR)
A zone transfer is meant to replicate the full DNS zone from a primary to a secondary nameserver. If a server doesn’t restrict who can request one, anyone asking gets the entire zone file back: every A record, every subdomain, every internal hostname the domain has defined.fierce automates a broader recon pass that checks for open zone transfers as part of its normal workflow, rather than needing to test it manually against every nameserver:
Subdomain Enumeration
When a zone transfer isn’t open, brute-forcing subdomains against a wordlist is the fallback. A few tools each take a slightly different approach.subfinder pulls from passive sources (certificate transparency logs, search engines, public datasets) instead of brute-forcing directly, which is faster and generates no traffic against the target’s own DNS infrastructure at all:
subbrute resolves a wordlist through a specific resolver list, useful when you want brute-forcing but through your own trusted resolvers rather than the target’s:
dnsdumpster.com runs a lot of this passively through a web UI and is worth checking first, it’s free, requires no setup, and often surfaces subdomains and hosting providers in seconds.
Reconnaissance Shortcuts
A couple of quick wins worth checking alongside the standard enumeration above.dnsrecon bundles standard lookups, zone transfer testing, and brute-forcing into a single pass, a reasonable one-command starting point before reaching for the more specialized tools above.
DNS Poisoning (Local Network)
DNS spoofing on a local network answers a victim’s DNS query before the real server can, redirecting them to an attacker-controlled IP instead.ettercap bundles this into a plugin rather than needing a custom responder.
1
Define the spoofed records
Edit ettercap’s DNS config file to map the target domain to your IP:
2
Scan for hosts
Launch
ettercap, then go to Hosts → Scan for Hosts to find live targets on the network.3
Set the targets
Add the victim’s IP as Target1 and the default gateway’s IP as Target2, positioning yourself for a man-in-the-middle between the two.
4
Enable DNS spoofing
Go to Plugins → Manage Plugins and activate
dns_spoof. From here, any DNS query from the victim matching your configured domains resolves to your IP instead of the real one.Subdomain Takeover
When a subdomain’s DNS record (usually a CNAME) still points to a third-party service, like a cloud platform or SaaS product, that’s no longer claimed, registering that resource on the provider’s side lets you serve content from the victim’s own subdomain.can-i-take-over-xyz catalogs which services are currently vulnerable to takeover and the exact fingerprint to look for in each case, essential reference once you’ve found a dangling CNAME.
Quick Reference Tools
Hackviser: DNS
Quick-reference pentesting guide for the DNS service.
HackTricks: DNS
Deeper breakdown of DNS enumeration and attack techniques.
dnsdumpster.com
Free passive DNS reconnaissance tool, good first stop before active enumeration.
can-i-take-over-xyz
Reference for identifying subdomain takeover vulnerabilities by service.

