On this page 15 sections
  1. How DNS fits together
  2. Common DNS record types
  3. Useful dig options
  4. Reverse DNS
  5. ANY queries
  6. Zone transfers with AXFR
  7. How to validate AXFR
  8. Subdomain discovery
  9. Check for wildcard DNS first
  10. Automate enumeration with dnsenum
  11. nslookup and host
  12. Delegated subdomains
  13. Practical DNS workflow
  14. Interesting findings
  15. Key takeaway
01

How DNS fits together

DNS is a hierarchical system used to map names to network information. A recursive resolver answers queries on behalf of clients, while authoritative name servers hold the official records for a DNS zone. During reconnaissance, identifying the authoritative servers is useful because they are the source of truth for that domain.

Find authoritative name servers
dig sam0x.me NS +short
Inspect zone authority
dig sam0x.me SOA
02

Common DNS record types

The most useful records are A for IPv4, AAAA for IPv6, MX for mail servers, NS for authoritative name servers, TXT for verification and service metadata, CNAME for aliases, SOA for zone information and PTR for reverse resolution.

IPv4
dig sam0x.me A
IPv6
dig sam0x.me AAAA
Mail servers
dig sam0x.me MX
Name servers
dig sam0x.me NS
TXT records
dig sam0x.me TXT
SOA
dig sam0x.me SOA
CNAME
dig www.sam0x.me CNAME
03

Useful dig options

dig can return either full DNS details or a simplified answer. +short is useful when scripting, while +trace shows the delegation path from the root servers to the authoritative server. The @ syntax forces the query to a specific DNS server.

Clean output
dig sam0x.me A +short
Query a specific DNS server
dig @ns1.sam0x.me sam0x.me A
Trace DNS resolution
dig sam0x.me +trace
04

Reverse DNS

PTR records map an IP address back to a hostname. Reverse DNS can reveal naming information that is not obvious from forward lookups, although it only works when PTR records have been configured.

Reverse lookup
dig -x 192.0.2.10
Alternative with host
host 192.0.2.10
05

ANY queries

ANY requests ask a DNS server for multiple record types, but they are not a reliable way to obtain every record in a zone. Modern DNS servers often restrict or minimise ANY responses.

ANY query
dig sam0x.me ANY
06

Zone transfers with AXFR

AXFR is a full DNS zone transfer normally used between authorised DNS servers. If a server is misconfigured and allows transfers from arbitrary clients, the response may reveal a large portion of the DNS zone in a single request.

Request a zone transfer
dig AXFR sam0x.me @ns1.sam0x.me
07

How to validate AXFR

A successful transfer returns multiple zone records instead of an error such as REFUSED or Transfer failed. If a domain has several authoritative name servers, each should be tested individually during an authorised assessment.

Discover name servers
dig sam0x.me NS +short
Test another authoritative server
dig AXFR sam0x.me @ns2.sam0x.me
08

Subdomain discovery

Subdomains can expose different applications, environments and services such as dev.sam0x.me, api.sam0x.me or mail.sam0x.me. Known names can be queried directly, while unknown names can be discovered with wordlists.

Query known subdomain
dig dev.sam0x.me A +short
Simple brute-force loop
for sub in $(cat /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt); do result=$(dig +short $sub.sam0x.me); if [ -n "$result" ]; then echo "$sub.sam0x.me $result"; fi; done
09

Check for wildcard DNS first

Some zones resolve any unknown hostname to the same address. This creates false positives during subdomain brute forcing. Test a random name before launching a large wordlist.

Wildcard test
dig random-92841.sam0x.me A +short
10

Automate enumeration with dnsenum

dnsenum automates several DNS reconnaissance tasks, including standard record queries, subdomain discovery and reverse lookups.

Basic enumeration
dnsenum --dnsserver ns1.sam0x.me sam0x.me
Use a subdomain wordlist
dnsenum --dnsserver ns1.sam0x.me -f /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt sam0x.me
Reverse lookup range
dnsenum --dnsserver ns1.sam0x.me -r 192.0.2.0/24
11

nslookup and host

dig is generally the most detailed tool, but nslookup and host are useful alternatives. nslookup is especially useful on Windows systems where dig may not be installed.

nslookup basic
nslookup sam0x.me
nslookup MX
nslookup -type=MX sam0x.me
host NS
host -t ns sam0x.me
host TXT
host -t txt sam0x.me
12

Delegated subdomains

A discovered subdomain may be its own DNS zone. If something like dev.sam0x.me has its own NS or SOA records, treat it as a separate namespace and enumerate it independently.

Check delegation
dig dev.sam0x.me NS
Inspect its SOA
dig dev.sam0x.me SOA
13

Practical DNS workflow

A useful sequence is to understand authority first, inspect meaningful records, test for zone-transfer exposure, then expand into subdomain discovery. This avoids unnecessary brute forcing and keeps the enumeration structured.

1. Authoritative servers
dig sam0x.me NS +short
2. Zone information
dig sam0x.me SOA
3. Infrastructure
dig sam0x.me A && dig sam0x.me MX && dig sam0x.me TXT
4. Trace delegation
dig sam0x.me +trace
5. Test AXFR
dig AXFR sam0x.me @ns1.sam0x.me
6. Check wildcard
dig random-92841.sam0x.me A +short
7. Enumerate subdomains
dnsenum --dnsserver ns1.sam0x.me -f /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt sam0x.me
14

Interesting findings

Record newly discovered subdomains, mail infrastructure, unusual TXT records, CNAMEs pointing to third-party services, delegated zones, successful AXFR responses, internal-looking hostnames and IP addresses that expose additional systems.

15

Key takeaway

DNS enumeration should move from structure to discovery: identify who is authoritative, understand the main records, check whether the zone exposes more information than intended, and only then expand into subdomain enumeration.