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

RecordPurposeWhat It Reveals
AIPv4 addressHostname → IP mapping
AAAAIPv6 addressIPv6 mapping
NSNameserverWho’s authoritative for the zone
MXMail exchangerMail server hostnames (often reveal SPF/DKIM policy too)
TXTArbitrary textSPF, DKIM, DMARC policies, domain verification tokens
CNAMECanonical name aliasReveals if a service is actually hosted on a cloud provider
SOAStart of authorityZone admin email, zone serial number
PTRReverse DNSIP → hostname (useful for netblock enumeration)
SRVService recordReveals 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.com

Alternative tools:

host inlanefreight.com
nslookup inlanefreight.com

Zone 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.com

If 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.txt

Wordlists 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"
done

Or with dnsrecon:

dnsrecon -r 10.0.0.0/24

SPF/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.com

Example 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 +trace to 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

  1. Query NS, MX, TXT, SOA for the base domain
  2. Try AXFR against every nameserver
  3. If AXFR blocked, brute-force with a wordlist
  4. Combine with certificate transparency subdomains
  5. Reverse DNS any discovered netblocks
  6. Analyze TXT records for cloud service hints
  7. Enumerate discovered subdomains the same way (recurse)