On this page 15 sections
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.
dig sam0x.me NS +shortdig sam0x.me SOACommon 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.
dig sam0x.me Adig sam0x.me AAAAdig sam0x.me MXdig sam0x.me NSdig sam0x.me TXTdig sam0x.me SOAdig www.sam0x.me CNAMEUseful 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.
dig sam0x.me A +shortdig @ns1.sam0x.me sam0x.me Adig sam0x.me +traceReverse 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.
dig -x 192.0.2.10host 192.0.2.10ANY 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.
dig sam0x.me ANYZone 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.
dig AXFR sam0x.me @ns1.sam0x.meHow 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.
dig sam0x.me NS +shortdig AXFR sam0x.me @ns2.sam0x.meSubdomain 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.
dig dev.sam0x.me A +shortfor 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; doneCheck 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.
dig random-92841.sam0x.me A +shortAutomate enumeration with dnsenum
dnsenum automates several DNS reconnaissance tasks, including standard record queries, subdomain discovery and reverse lookups.
dnsenum --dnsserver ns1.sam0x.me sam0x.mednsenum --dnsserver ns1.sam0x.me -f /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt sam0x.mednsenum --dnsserver ns1.sam0x.me -r 192.0.2.0/24nslookup 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 sam0x.menslookup -type=MX sam0x.mehost -t ns sam0x.mehost -t txt sam0x.meDelegated 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.
dig dev.sam0x.me NSdig dev.sam0x.me SOAPractical 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.
dig sam0x.me NS +shortdig sam0x.me SOAdig sam0x.me A && dig sam0x.me MX && dig sam0x.me TXTdig sam0x.me +tracedig AXFR sam0x.me @ns1.sam0x.medig random-92841.sam0x.me A +shortdnsenum --dnsserver ns1.sam0x.me -f /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt sam0x.meInteresting 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.
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.