Extract DNS zone files from any domain.
dzone queries authoritative nameservers and reconstructs a BIND-compatible zone file from public DNS records.
brew tap prenansantana/tap
brew install dzonenpx dzone-cli example.comnpm install -g dzone-cligo install github.com/prenansantana/extract-zone-file@latestDownload from Releases — single binary, no dependencies.
# Extract all DNS records
dzone example.com
# Save to file
dzone example.com -o example.com.zone
# Filter specific record types
dzone example.com -t A,MX,TXT
# Use a specific DNS server
dzone example.com -s 1.1.1.1Standard BIND zone file format:
; Zone file for example.com
; Generated by dzone on 2026-03-04T15:30:00Z
; Queried server: a.iana-servers.net.:53 (authoritative)
; NOTE: Best-effort reconstruction via individual queries.
$ORIGIN example.com.
$TTL 300
; SOA Records
example.com. 86400 IN SOA ns1.example.com. admin.example.com. 2024010101 7200 3600 1209600 3600
; NS Records
example.com. 86400 IN NS ns1.example.com.
example.com. 86400 IN NS ns2.example.com.
; A Records
example.com. 300 IN A 93.184.216.34
; MX Records
example.com. 300 IN MX 10 mail.example.com.
; TXT Records
example.com. 300 IN TXT "v=spf1 -all"
| Flag | Description | Default |
|---|---|---|
-s |
DNS server to query | auto-detect authoritative |
-o |
Output file | stdout |
-t |
Record types (comma-separated) | all |
-try-axfr |
Attempt zone transfer first | true |
-v |
Show version |
A, AAAA, CNAME, MX, NS, SOA, TXT, SRV, CAA, PTR
- Discovers authoritative nameservers for the domain
- Attempts a zone transfer (AXFR) — works when allowed
- Falls back to querying each record type individually (concurrent)
- Discovers subdomains via Certificate Transparency (crt.sh) and queries each for CNAME records
- Formats results as a standard BIND zone file
make build # local binary
make build-all # cross-compile (linux, darwin, windows)Releases are fully automated via GitHub Actions. To publish a new version:
git tag v0.3.0
git push origin v0.3.0This automatically:
- Cross-compiles binaries for Linux, macOS, and Windows
- Creates a GitHub Release with all binaries
- Updates the Homebrew formula with new checksums
- Publishes the new version to npm