A high-performance subdomain permutation and DNS resolution tool written in Go. This is a modern reimplementation of the original altdns by @shubs, built for speed and reliability.
- Blazing Fast: Parallel DNS resolution with configurable worker pools
- Smart Wildcard Detection: Automatically detects and filters wildcard DNS records
- DNS over HTTPS (DoH): Bypass ISP DNS blocking and rate limiting
- Resolver Health Checking: Automatically detects and skips dead/slow resolvers
- Custom Resolver Support: Load hundreds of resolvers from a file
- Multiple Output Formats: Plain text, JSON, and CSV
- Resume Capability: Checkpoint support for long-running scans
- Input Deduplication: Automatically removes duplicate domains
- IP Filtering: Filter out known catch-all/sinkhole IPs
git clone https://github.com/YOUR_USERNAME/altdns-ng.git
cd altdns-ng
go build -o altdns-ng .
sudo mv altdns-ng /usr/local/bin/- Go 1.21 or higher
altdns-ng [options]
| Flag | Description |
|---|---|
-i, --input |
Input file with subdomains (use - for stdin) |
-o, --output |
Output file (use - for stdout, default: -) |
-w, --wordlist |
Wordlist for permutations (uses built-in if not set) |
-r, --resolve |
Resolve generated subdomains via DNS |
-t, --threads |
Number of concurrent workers (default: 100) |
-q, --quiet |
Quiet mode (no progress display) |
-v, --verbose |
Verbose output |
| Flag | Description |
|---|---|
-d, --dns |
DNS servers, comma-separated (default: 8.8.8.8,1.1.1.1,9.9.9.9) |
-rf, --resolver-file |
File containing DNS resolvers (one per line) |
--timeout |
DNS query timeout (default: 3s) |
--retries |
Retry count for failed queries (default: 2) |
--rate-limit |
Max queries per second, 0=unlimited (default: 0) |
| Flag | Description |
|---|---|
--doh |
Use DNS over HTTPS instead of UDP DNS |
--doh-server |
DoH server URL (default: cloudflare-dns.com) |
| Flag | Description |
|---|---|
-f, --format |
Output format: plain, json, csv (default: plain) |
--show-ip |
Include resolved IPs in output |
--show-cname |
Include CNAME records in output |
| Flag | Description |
|---|---|
--wildcard-detection |
Enable wildcard DNS detection (default: true) |
--health-check |
Enable resolver health checking (default: true) |
--filter-ip |
Comma-separated IPs to filter out |
| Flag | Description |
|---|---|
--patterns |
Comma-separated patterns to use |
--no-numbers |
Disable number suffix patterns |
--extended-numbers |
Use 00-99 instead of 0-9 |
insert- Insert word at all positionsdash-prefix- Add word with dash prefix (word-subdomain)dash-suffix- Add word with dash suffix (subdomain-word)join-prefix- Join word as prefix (wordsubdomain)join-suffix- Join word as suffix (subdomainword)number-suffix- Add numbers 0-9 as suffixextended-numbers- Add numbers 00-99 as suffixversion-prefix- Add version prefixes (v1, v2, etc.)version-suffix- Add version suffixesenvironment- Add environment words (dev, staging, prod)region- Add region words (us, eu, asia)year- Add year suffixes (2023, 2024, 2025)underscore- Add word with underscore separator
altdns-ng -i subdomains.txt -o permutations.txtaltdns-ng -i subdomains.txt -r -o results.txtaltdns-ng -i subdomains.txt -r --show-ip -o results.txtaltdns-ng -i subdomains.txt -w custom_words.txt -r -o results.txt# Create a resolver file (one IP per line)
echo "8.8.8.8" > resolvers.txt
echo "1.1.1.1" >> resolvers.txt
echo "9.9.9.9" >> resolvers.txt
# Use the resolver file
altdns-ng -i subdomains.txt -r -rf resolvers.txt -o results.txtUseful when ISP is rate-limiting or blocking UDP DNS:
altdns-ng -i subdomains.txt -r --doh -o results.txtUse a different DoH provider:
altdns-ng -i subdomains.txt -r --doh --doh-server "https://dns.google/dns-query" -o results.txtaltdns-ng -i subdomains.txt -r -f json --show-ip --show-cname -o results.jsonaltdns-ng -i subdomains.txt -r -f csv --show-ip -o results.csvaltdns-ng -i subdomains.txt -r --filter-ip "1.2.3.4,5.6.7.8" -o results.txtaltdns-ng -i subdomains.txt -r -rf resolvers.txt -t 500 --show-ip -o results.txtaltdns-ng -i subdomains.txt -r --patterns "dash-prefix,dash-suffix" -o results.txtcat subdomains.txt | altdns-ng -i - -r -q | tee results.txt# Start scan with checkpoint
altdns-ng -i large_list.txt -r --checkpoint scan.ckpt -o results.txt
# Resume if interrupted
altdns-ng -i large_list.txt -r --resume scan.ckpt -o results.txtaltdns-ng -i subdomains.txt -r --rate-limit 100 -o results.txtaltdns-ng -i subdomains.txt -r -v --show-ip -o results.txtaltdns-ng -i subdomains.txt \
-w wordlist.txt \
-r \
-rf resolvers.txt \
-t 300 \
--show-ip \
--filter-ip "127.0.0.1,0.0.0.0" \
-f json \
-o results.jsonadmin.example.com
api.example.com : 93.184.216.34
dev.example.com : 93.184.216.35
{"domain":"api.example.com","ips":["93.184.216.34"],"resolved":true}
{"domain":"dev.example.com","ips":["93.184.216.35"],"cnames":["dev-lb.example.com."],"resolved":true}domain,ips,cnames,resolved
api.example.com,93.184.216.34,,true
dev.example.com,93.184.216.35,dev-lb.example.com.,true
After each scan, altdns-ng displays a detailed summary:
+----------------------------------------------+
| SCAN COMPLETE - SUMMARY |
+----------------------------------------------+
| Total Processed: 150000 |
| Subdomains Found: 1234 |
+----------------------------------------------+
| Wildcard Filtered: 50000 |
| IP Filtered: 2000 |
| Errors: 10000 |
+----------------------------------------------+
| Duration: 5m30s |
| Avg Rate: 450 q/s |
+----------------------------------------------+
- Use Multiple Resolvers: Create a file with 50-100 public DNS resolvers for faster scans
- Enable DoH: If you're getting rate-limited, use
--dohto bypass ISP restrictions - Filter Wildcards: Use
--filter-ipto exclude known catch-all IPs - Adjust Threads: Start with
-t 100and increase based on your network - Use Checkpoints: For large scans, always use
--checkpointto enable resume
This tool is based on the original altdns created by @shubs (infosec-au).
Created by @OriginalSicksec
MIT License