A simple Bash script to measure the latency and response time of multiple DNS servers.
- Measures ping latency to DNS servers
- Checks DNS query response times
- Supports parallel execution for faster results
- Sorts results based on response time
- Highlights fastest and slowest DNS servers
bash
shellping
commanddig
command (available indnsutils
package on Debian-based systems)
Clone the repository:
git clone https://github.com/BaseMax/DNS-Latency-Test.git
cd DNS-Latency-Test
Run the script:
./dns-latency-test.sh
- Edit
dns-servers.txt
to add or remove DNS servers. - Modify the
PING_TIMEOUT
variable in the script to change the timeout duration.
Testing DNS latency (Max: 10s)...
------------------------------------------------------
DNS Server Ping (ms) Query Time (ms)
------------------------------------------------------
8.8.8.8 12 ms 30 ms
1.1.1.1 8 ms 15 ms
9.9.9.9 20 ms 50 ms
------------------------------------------------------
🚀 Fastest DNS: 1.1.1.1 (15 ms)
🐢 Slowest DNS: 9.9.9.9 (50 ms)
This project is licensed under the MIT License. See the LICENSE file for details.
The idea for this project is originally inspired by DNS-Test-Speed.
Copyright (c) 2025 Max Base