Prerequisites
- Target system, dependencies and environment configured.
Usage
Purpose
DNS tells you where things live before you ever connect. Mail servers, cloud providers, old hosts nobody cleaned up, sometimes a whole zone if the server is misconfigured. This skill walks the record types worth pulling and what each one gives away.
When to use it
Early recon, right alongside subdomain enumeration. It's passive against public resolvers, so it's safe to run before active scanning is authorised — you're asking the internet's phone book, not knocking on doors.
Procedure
- Pull the core records for the domain. Each answers a different question — who hosts mail, who's authoritative, what the apex points at:
dig example.com ANY +noall +answer
dig example.com MX +short
dig example.com NS +short
dig example.com TXT +short
- Read the TXT records carefully. SPF, DKIM, DMARC, and verification tokens for third-party services (
google-site-verification, atlassian-, etc.) quietly reveal which SaaS the org uses.
- Try a zone transfer against each authoritative nameserver. It should fail — when it doesn't, you get the entire zone in one request:
dig AXFR example.com @ns1.example.com
- Check for wildcard DNS before you trust any brute-force list, or you'll chase ghosts:
dig random-does-not-exist-12345.example.com +short
- Reverse-map the IP ranges you've found to tie hosts back to the org and spot shared infrastructure:
dig -x 203.0.113.10 +short
Cheatsheet
dig example.com MX +short # mail infra
dig example.com NS +short # authoritative servers
dig example.com TXT +short # spf/dkim/dmarc, saas tokens
dig AXFR example.com @ns1... # zone transfer (should fail)
dig -x 203.0.113.10 +short # reverse lookup
dnsrecon -d example.com -a # automated sweep incl. AXFR attempt
dnsx -l names.txt -cname -resp # resolve + show CNAME targets
Reading the output
- A successful AXFR is a finding on its own — the nameserver hands you every record, a full map of the internal naming.
- CNAMEs pointing at a dead SaaS target (a storage bucket or app that no longer exists) is a subdomain-takeover lead.
- SPF/DMARC missing or
~all/?all means the domain is spoofable — flag it for the phishing-defence work.
- TXT verification tokens enumerate the org's third-party stack without touching any of it.
Pitfalls
- Wildcard DNS makes every name resolve. Confirm it exists before brute-forcing, or filter wildcards in your resolver.
- Cached vs live. Public resolvers cache; query the authoritative server directly (
@ns1...) when you need current truth.
- Assuming AXFR is always closed. It usually is — but it costs one query to check, and the payoff when it's open is the whole zone.
References
- OWASP WSTG-INFO-02 (Fingerprint, DNS)
- RFC 1035, RFC 7208 (SPF)
- dnsrecon and dnsx documentation
Inputs
- Relevant source code, logs, network traces, or system specifications.
Outputs
- Analysis findings, security audit report, or generated code artifacts.
1---2name: dns-recon3description: Use when you want to pull records, zone data, and infrastructure hints out of a target's DNS alone — the quiet recon step before you touch a single host.4---5678## Prerequisites9- Target system, dependencies and environment configured.1011## Usage12### Purpose1314DNS tells you where things live before you ever connect. Mail servers, cloud providers, old hosts nobody cleaned up, sometimes a whole zone if the server is misconfigured. This skill walks the record types worth pulling and what each one gives away.1516### When to use it1718Early recon, right alongside subdomain enumeration. It's passive against public resolvers, so it's safe to run before active scanning is authorised — you're asking the internet's phone book, not knocking on doors.1920### Procedure21221. Pull the core records for the domain. Each answers a different question — who hosts mail, who's authoritative, what the apex points at:23 ```24 dig example.com ANY +noall +answer25 dig example.com MX +short26 dig example.com NS +short27 dig example.com TXT +short28 ```292. Read the TXT records carefully. SPF, DKIM, DMARC, and verification tokens for third-party services (`google-site-verification`, `atlassian-`, etc.) quietly reveal which SaaS the org uses.303. Try a zone transfer against each authoritative nameserver. It should fail — when it doesn't, you get the entire zone in one request:31 ```32 dig AXFR example.com @ns1.example.com33 ```344. Check for wildcard DNS before you trust any brute-force list, or you'll chase ghosts:35 ```36 dig random-does-not-exist-12345.example.com +short37 ```385. Reverse-map the IP ranges you've found to tie hosts back to the org and spot shared infrastructure:39 ```40 dig -x 203.0.113.10 +short41 ```4243### Cheatsheet4445```bash46dig example.com MX +short # mail infra47dig example.com NS +short # authoritative servers48dig example.com TXT +short # spf/dkim/dmarc, saas tokens49dig AXFR example.com @ns1... # zone transfer (should fail)50dig -x 203.0.113.10 +short # reverse lookup51dnsrecon -d example.com -a # automated sweep incl. AXFR attempt52dnsx -l names.txt -cname -resp # resolve + show CNAME targets53```5455### Reading the output5657- A **successful AXFR** is a finding on its own — the nameserver hands you every record, a full map of the internal naming.58- **CNAMEs pointing at a dead SaaS target** (a storage bucket or app that no longer exists) is a subdomain-takeover lead.59- **SPF/DMARC missing or `~all`/`?all`** means the domain is spoofable — flag it for the phishing-defence work.60- **TXT verification tokens** enumerate the org's third-party stack without touching any of it.6162### Pitfalls6364- **Wildcard DNS** makes every name resolve. Confirm it exists before brute-forcing, or filter wildcards in your resolver.65- **Cached vs live.** Public resolvers cache; query the authoritative server directly (`@ns1...`) when you need current truth.66- **Assuming AXFR is always closed.** It usually is — but it costs one query to check, and the payoff when it's open is the whole zone.6768### References6970- OWASP WSTG-INFO-02 (Fingerprint, DNS)71- RFC 1035, RFC 7208 (SPF)72- dnsrecon and dnsx documentation7374## Inputs75- Relevant source code, logs, network traces, or system specifications.7677## Outputs78- Analysis findings, security audit report, or generated code artifacts.