dns-bench
Description
This repository provides a DNS benchmarking command-line tool written in Rust. It iterates through a built-in list of public DNS servers as well as automatically detected system DNS servers, measures their response times, and prints a table of sorted results in the console. You can use it to find the fastest DNS server for your location, improving your internet browsing experience. A preview, list of features, and the list of built-in DNS servers are provided below.
Preview
Image
Animation
Features
🚀 Core Features
- Built-in list of public DNS servers
Includes popular providers like Google, Cloudflare, Quad9, and more. - Automatic detection of system DNS servers
Detects and highlights your system's configured DNS servers (Linux, Windows, macOS). - Multi-threaded benchmarking
Runs benchmarks in parallel for faster results.
⚙️ Configuration & Flexibility
- Customizable request count, thread count, timeout, and domain
Fine-tune how many requests, threads, and which domain to test. - Protocol and IP version selection
Choose between UDP/TCP and IPv4/IPv6 for both lookup and connection. - Custom DNS server lists
Use your own list of DNS servers instead of the built-in set.
📊 Output & Usability
- Multiple output formats
Human-readable table, JSON, XML, or CSV for easy integration and analysis. - Configurable table styles
Choose from various table styles for better readability. - Save favorite configurations
Store your preferred settings in a config file for quick reuse.
🐳 Platform & Integration
- Docker support
Run easily in a containerized environment (system DNS detection is skipped in Docker). - Cross-platform
Works on Linux, Windows, and macOS.
List of built-in DNS servers
- Google Public DNS
- Cloudflare
- Quad9
- ControlD
- OpenDNS
- CleanBrowsing
- AdGuard DNS
- Comodo Secure DNS
- Level3
- Verisign
- DNS.WATCH
- Norton ConnectSafe
- SafeDNS
- NextDNS
- Dyn
- Hurricane Electric
- Surfshark DNS
- SafeServe
Installation
Which method to choose?
- If you don't have Rust programming language environment installed on your machine, then you can choose between installation from Docker Hub or download the latest Windows executable file.
- If you have Rust programming language environment installed on your machine, then you can choose between installation from crates.io or installation from git repository.
- Installation from git repository is suitable only when you want to use the development version instead of the stable one or the crates.io service is unavailable.
From crates.io using Cargo
Run the following command and wait until the crate is compiled:
Now you can run compiled binary:
From git repository using Cargo
Run the following command and wait until the crate is compiled:
Also you can remove tag option to install the latest development version.
Now you can run compiled binary:
From Docker Hub
Run the following command to pull the image:
Now you can run this tool inside the container:
If you want to pass some options, you can do it like this:
In case you want to use custom servers list, you have to mount the file with custom servers list to the container and pass the path to the file as an argument:
Executable file for Windows
You can download the latest Windows executable file from the releases page.
After downloading, open the command line, navigate to the directory where you saved the file, and run it with the following command:
dns-bench.exe [OPTIONS]
[!WARNING] The Windows executable file is not signed, so you may see a warning when running it. You can ignore this warning if you trust the source of the file. If you want to avoid this warning, you can build the crate from source using Rust programming language environment installed on your machine or use the Docker image as described above.
Options
Below is a list of currently supported options.
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.