DNSperf is a tool for testing the performance of DNS servers in resolving A records, which can help you choose the most suitable DNS for your local network.
- Python 3.12.3
Yon can download from https://www.python.org/.
- dnspython
- numpy
- pandas
- requests
Run the this code in bash (Linux) or cmd (Windows) to install dependency libraries.
pip install dnspython
pip install numpy
pip install pandas
pip install requests
You can add domain name that you want to test the DNS in domain_names.json.
[
"www.github.com",
"www.baidu.com"
]
You can add DNS server that you want to test in dns_server.json.
{
"DNS": [
{
"name": "Alibaba DNS",
"addr": "223.5.5.5"
},
{
"name": "Google DNS",
"addr": "8.8.8.8"
}
],
"DoH": [
{
"name": "Alibaba DoH",
"addr": "https://dns.alidns.com:443/dns-query"
},
{
"name": "Google DoH",
"addr": "https://dns.google/dns-query"
}
]
}
Run the source code.
python DNSperf.py
Run the source code and output the test results to result.log.
python DNSperf.py --log result
Run DNSperf on the Windows system and output the test results to result.log.
DNSperf.exe --log result
- Support DNS(IP Address)
- Support DNS over HTTPS (RFC 8484, supports GET and POST)
- Support DNS over HTTPS (JSON API, supports GET)
- Support DNS over TLS
- Add circuit breaker function, end the DNS test directly if there is no response after multiple resolutions, to avoid waiting for too long
- Optimize DNS testing algorithm to avoid triggering QoS
Due to some public DNS adopting QoS policies, the test results may be inaccurate.