DNS is reconnaissance gold — it maps every named host, reveals mail infrastructure, often leaks internal hostnames, and sometimes allows a full zone transfer that hands you the entire naming scheme in one request.
DNS Record Types Worth Knowing
| Record | Purpose | What It Reveals |
|---|---|---|
A | IPv4 address | Hostname → IP mapping |
AAAA | IPv6 address | IPv6 mapping |
NS | Nameserver | Who’s authoritative for the zone |
MX | Mail exchanger | Mail server hostnames (often reveal SPF/DKIM policy too) |
TXT | Arbitrary text | SPF, DKIM, DMARC policies, domain verification tokens |
CNAME | Canonical name alias | Reveals if a service is actually hosted on a cloud provider |
SOA | Start of authority | Zone admin email, zone serial number |
PTR | Reverse DNS | IP → hostname (useful for netblock enumeration) |
SRV | Service record | Reveals service port and target (common in AD environments) |
Querying Individual Records
# single record type
dig A inlanefreight.com
dig MX inlanefreight.com
dig TXT inlanefreight.com
dig NS inlanefreight.com
# all records
dig ANY inlanefreight.com
# against a specific nameserver
dig @8.8.8.8 inlanefreight.com
# short output (just the value)
dig +short MX inlanefreight.comAlternative tools:
host inlanefreight.com
nslookup inlanefreight.comZone Transfer (AXFR)
A zone transfer dumps the entire zone from an authoritative server. It’s supposed to be restricted to secondary nameservers, but misconfigured servers allow anyone:
# find the nameservers
dig +short NS inlanefreight.com
# try zone transfer against each one
dig axfr @ns1.inlanefreight.com inlanefreight.com
dig axfr @ns2.inlanefreight.com inlanefreight.comIf it works, you get every record in the zone — subdomains, internal hostnames, mail routes, everything.
Most modern servers block AXFR, but internal DNS servers in CTF labs and old corporate setups often permit it.
DNS Brute Force
When zone transfer is blocked (usually), brute-force subdomains:
# gobuster
gobuster dns -d inlanefreight.com -w subdomains.txt
# dnsrecon
dnsrecon -d inlanefreight.com -D subdomains.txt -t brt
# puredns (very fast)
puredns bruteforce subdomains.txt inlanefreight.com -r resolvers.txtWordlists worth trying:
/usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt
/usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt
/usr/share/seclists/Discovery/DNS/fierce-hostlist.txt
Reverse DNS on a Netblock
If you have a netblock, reverse DNS sometimes reveals internal naming conventions:
for ip in $(seq 1 254); do
host 10.0.0.$ip | grep "name pointer"
doneOr with dnsrecon:
dnsrecon -r 10.0.0.0/24SPF/DMARC Record Analysis
TXT records for mail domains often leak:
- Sub-domain mail servers (SPF
include:directives) - Email providers (Google, Microsoft 365, Mailgun)
- DMARC policy strictness (lenient policies = good target for spoofing)
dig +short TXT inlanefreight.com
dig +short TXT _dmarc.inlanefreight.comExample SPF:
v=spf1 include:_spf.google.com include:mailgun.org include:sendgrid.net ~all
Tells you: Google Workspace + Mailgun + SendGrid. Useful for crafting phishing or impersonating the right sender.
Hidden Subdomain Hints
TXT records sometimes contain domain verification tokens that reveal what services the company uses:
google-site-verification=xxxxx → Google Workspace
MS=ms12345678 → Microsoft 365
atlassian-domain-verification=xxxxx → Atlassian (Jira/Confluence)
docusign=xxxxx → DocuSign in use
Each service hint = potential subdomain to probe (atlassian.inlanefreight.com, docs.inlanefreight.com).
Common Pitfalls
- Cached DNS — results you get may be from your resolver’s cache. Use
+traceto see the full resolution chain. - Split DNS — internal and external DNS may give different answers. If you can get on the internal network, re-query.
- GeoDNS — some responses vary by requester location. Query from different geographic sources.
Methodology
- Query
NS,MX,TXT,SOAfor the base domain - Try AXFR against every nameserver
- If AXFR blocked, brute-force with a wordlist
- Combine with certificate transparency subdomains
- Reverse DNS any discovered netblocks
- Analyze TXT records for cloud service hints
- Enumerate discovered subdomains the same way (recurse)
