A high-performance DNS benchmarking utility written in Go.
- Measure query latency (Avg, Min, Max)
- Supports UDP, DoT (DNS over TLS), and DoH (DNS over HTTPS)
- Track packet loss/errors
- Concurrent queries
- Customizable server and domain lists
- Export results to CSV
Standard (macOS/Linux with local build tools): Includes Browser History support (requires CGO).
go build -o dns-benchCross-Compile for Linux ARM64 (e.g., Raspberry Pi): Note: Browser history import is disabled in CGO-free builds.
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o dns-bench-linux-arm64Cross-Compile for Linux AMD64 (Servers):
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o dns-bench-linux-amd64./dns-bench -c int
Number of concurrent queries (default 50)
-n int
Number of iterations per domain per server (default 1)
-t duration
Timeout for each query (default 1s)
-d duration
Duration to run benchmark (e.g. 30s). Overrides -n if set.
-domains string
File containing list of domains (one per line or CSV)
-browser string
Import domains from browser history (chrome, brave, safari, firefox)
-servers string
File containing list of servers (one per line or YAML)
-o string
Output CSV file for raw results
-html string
Output HTML report file
-v
Verbose logging (show errors and slow queries)
The tool can extract domains directly from your browser history.
./dns-bench -browser safariNote on macOS Permissions: If you see a "Permission Denied" error (especially with Safari), you need to grant Full Disk Access to your terminal application (e.g., Terminal, iTerm2, VSCode) in System Settings -> Privacy & Security.
Alternative Workaround: If you prefer not to grant full permissions, or if direct integration fails, you can use the included helper script:
# Export history to a file
./scripts/export_history.sh safari my_domains.csv
# Run benchmark with the exported file
./dns-bench -domains my_domains.csv./dns-bench -c 50Run for a specific duration (e.g., 30 seconds):
./dns-bench -d 30sTest with domains from your Chrome history:
./dns-bench -browser chromeRun 10 iterations per domain:
./dns-bench -n 10Use custom lists (TXT, YAML, CSV):
./dns-bench -servers servers.yaml -domains top-1000.csvYAML Server File Format:
Supports standard UDP, DoT (tls://), and DoH (https://).
servers:
- 8.8.8.8 # UDP
- tls://1.1.1.1 # DoT
- https://dns.google/dns-query # DoHCSV Domain File Format: The tool supports both simple lists and structured CSVs. It will look for a column named "domain" or default to the first column.
Simple:
google.com
netflix.comStructured:
rank,domain,traffic
1,google.com,high
2,facebook.com,highExport results:
./dns-bench -o results.csv