|
1 | 1 | # pingerr |
2 | 2 |
|
3 | | -A comprehensive DNS benchmarking tool that tests 60+ public DNS servers to find the fastest and most reliable DNS resolver for your network. |
| 3 | +A comprehensive DNS benchmarking tool that tests 50+ public DNS servers to find the fastest and most reliable DNS resolver for your network. |
4 | 4 |
|
5 | 5 | ## Features |
6 | 6 |
|
7 | | -- **Tests 60+ DNS Servers**: Including Google, Cloudflare, Quad9, OpenDNS, AdGuard, and many more |
8 | | -- **Multiple Test Iterations**: Performs 5 tests per server using different popular domains |
| 7 | +- **Tests 50+ DNS Servers**: Including Google, Cloudflare, Quad9, OpenDNS, AdGuard, and many more |
| 8 | +- **Cache-Aware Testing**: Warmup queries ensure accurate cached response time measurements |
| 9 | +- **Multiple Test Iterations**: Performs 5 tests per server (configurable via `-n` flag) |
9 | 10 | - **DNS-Ping Correlation Analysis**: Measures both DNS query time and network latency |
10 | 11 | - **Smart Scoring System**: Weighted scoring (70% DNS, 30% ping) for optimal server selection |
11 | 12 | - **Color-Coded Results**: Visual indicators for performance (Green = Excellent, Yellow = Good, Red = Slow) |
12 | 13 | - **Configuration Recommendations**: Provides ready-to-use primary and secondary DNS suggestions |
13 | 14 |
|
14 | | -## What It Tests |
| 15 | +## How It Works |
15 | 16 |
|
16 | | -The script evaluates DNS servers across 15 popular domains including: |
17 | | -- google.com, youtube.com, facebook.com |
18 | | -- instagram.com, chatgpt.com, x.com |
19 | | -- whatsapp.com, reddit.com, wikipedia.org |
20 | | -- amazon.com, tiktok.com, cloudflare.com |
21 | | -- github.com, netflix.com, pinterest.com |
| 17 | +The script uses a **cache-aware benchmarking** approach: |
| 18 | + |
| 19 | +1. **Warmup Query**: Sends an initial DNS query to prime the server's cache |
| 20 | +2. **Measurement Queries**: Performs 5 subsequent queries to measure cached response time |
| 21 | +3. **Median Calculation**: Uses the median of all measurements for robust results |
| 22 | + |
| 23 | +This approach measures the actual network latency to each DNS server, rather than recursive resolution time, giving results that correlate closely with ping latency. |
| 24 | + |
| 25 | +By default, `google.com` is used as the test domain, but you can customize this with the `-d` flag. |
22 | 26 |
|
23 | 27 | ## Videos |
24 | 28 | ### Demo Videos |
@@ -81,6 +85,46 @@ chmod +x /tmp/pingerr_ash.sh |
81 | 85 | /tmp/pingerr_ash.sh |
82 | 86 | ``` |
83 | 87 |
|
| 88 | +## Command Line Options |
| 89 | + |
| 90 | +``` |
| 91 | +Options: |
| 92 | + -4, --ipv4-only Test only IPv4 DNS servers |
| 93 | + -6, --ipv6-only Test only IPv6 DNS servers (requires IPv6 connectivity) |
| 94 | + -n, --count N Number of tests per server (default: 5) |
| 95 | + -d, --domain NAME Domain/IP to use for DNS queries (default: google.com) |
| 96 | + -q, --quick Quick mode (3 tests per server) |
| 97 | + --no-ping Skip ping correlation test |
| 98 | + --no-color Disable colored output |
| 99 | + -h, --help Show help message |
| 100 | + -v, --version Show version |
| 101 | +``` |
| 102 | + |
| 103 | +### Examples |
| 104 | + |
| 105 | +```bash |
| 106 | +# Run full test (IPv4 + IPv6 if available) |
| 107 | +./pingerr.sh |
| 108 | + |
| 109 | +# Test only IPv4 servers |
| 110 | +./pingerr.sh -4 |
| 111 | + |
| 112 | +# Quick test with fewer iterations |
| 113 | +./pingerr.sh -q |
| 114 | + |
| 115 | +# Use a custom domain for DNS queries |
| 116 | +./pingerr.sh -d github.com |
| 117 | + |
| 118 | +# Use an IP address for consistent measurements |
| 119 | +./pingerr.sh -d 1.1.1.1 |
| 120 | + |
| 121 | +# Skip ping correlation analysis |
| 122 | +./pingerr.sh --no-ping |
| 123 | + |
| 124 | +# Run 10 tests per server for more accuracy |
| 125 | +./pingerr.sh -n 10 |
| 126 | +``` |
| 127 | + |
84 | 128 | ## Prerequisites |
85 | 129 |
|
86 | 130 | ### For Regular Systems |
@@ -117,7 +161,7 @@ opkg install drill |
117 | 161 | The script provides a complete ranking of all tested DNS servers: |
118 | 162 | ``` |
119 | 163 | ┌──────┬──────────────────────────────────────┬───────────────────────┬───────────┐ |
120 | | -│ Rank │ DNS Server │ IP Address │ Avg Time │ |
| 164 | +│ Rank │ DNS Server │ IP Address │ Median │ |
121 | 165 | ├──────┼──────────────────────────────────────┼───────────────────────┼───────────┤ |
122 | 166 | │ 1 │ Cloudflare-Primary │ 1.1.1.1 │ 12 ms │ |
123 | 167 | │ 2 │ Google-Primary │ 8.8.8.8 │ 15 ms │ |
@@ -180,25 +224,22 @@ System Preferences > Network > Advanced > DNS |
180 | 224 |
|
181 | 225 | 🏆 BEST DNS SERVER: Cloudflare-Primary |
182 | 226 | IP Address: 1.1.1.1 |
183 | | - Average Response Time: 12 ms |
| 227 | + Median Response Time: 12 ms |
184 | 228 |
|
185 | 229 | CONFIGURATION RECOMMENDATION: |
186 | 230 | Primary DNS: 1.1.1.1 (Cloudflare-Primary - 12ms) |
187 | 231 | Secondary DNS: 8.8.8.8 (Google-Primary - 15ms) |
188 | 232 | ``` |
189 | 233 |
|
190 | | -# Advanced Options |
| 234 | +## Advanced Usage |
191 | 235 |
|
192 | | -### Modify Test Parameters |
| 236 | +### Modify DNS Server List |
193 | 237 |
|
194 | | -Edit the script to adjust: |
195 | | -- `TEST_COUNT`: Number of tests per server (default: 5) |
196 | | -- `TEST_DOMAINS`: Domains to test against |
197 | | -- `DNS_SERVERS`: Add or remove DNS servers |
| 238 | +Edit the script to add or remove DNS servers from the `DNS_NAMES_IPV4`/`DNS_IPS_IPV4` arrays (or `DNS_SERVERS_IPV4` for ash version). |
198 | 239 |
|
199 | | -### Run Specific Tests Only |
| 240 | +### IPv6 Testing |
200 | 241 |
|
201 | | -For quick tests, you can modify the DNS_SERVERS list in the script to include only servers you're interested in. |
| 242 | +The script automatically detects IPv6 connectivity. Use `-6` to test only IPv6 servers, or `-4` to skip IPv6 entirely. |
202 | 243 |
|
203 | 244 | ## Troubleshooting |
204 | 245 |
|
|
0 commit comments