Resolvalid is a Go tool that will generate or validate a list of DNS servers, providing you with a file containing only valid DNS servers.
To install Resolvalid, use the go install
command:
go install github.com/mmarting/resolvalid@latest
Use -h to display the help for the tool:
resolvalid -h
Resolvalid requires an output (-o) file name as the only mandatory parameter. The tool admits the following options:
-o, --output: Output file for valid DNS servers (required).
-f, --file: File containing the list of DNS servers (optional).
-u, --url: URL containing the file of DNS servers (optional, default: https://public-dns.info/nameservers.txt).
-td, --test-domain: Domain used to test DNS servers (optional, default: randomly chosen from predefined domains).
-t, --threads: Number of concurrent threads (optional, default: 20).
-to, --timeout: Timeout for DNS queries (optional, default: 2s).
-s, --silent: Suppress output to the screen (optional).
-h, --help: Display help information.
Use a local file with DNS Servers and output valid ones to a file:
resolvalid -f dns_servers.txt -o valid_servers.txt
Use a URL hosting a list of DNS Servers and output valid ones to a file with custom timeout:
resolvalid -u https://example.com/dns_list.txt -o valid_servers.txt -to 5s
Suppress screen output, use custom test domain and use 50 threads:
resolvalid -f dns_servers.txt -o valid_servers.txt -td mytestdomain.com -t 50 -s
This tool was created as a project for learning Go, so don't expect a highly optimized code. At the same time, I was trying to reduce the time my recon automation tool was taking to validate my DNS servers list, which I've achieved with this tool.
-
vortexau: For inspiring me to write this tool after a few years of using their tool to validate my DNS server lists: dnsvalidator
-
miek: For creating the Go DNS library I'm using in this tool: dns
Martín Martín
resolvalid
is distributed under GPL v3 License.