Skip to content

Commit 131408c

Browse files
Merge pull request #13 from Panchajanya1999/improvements
Improvements to pingerr
2 parents b29c1a6 + 20da23e commit 131408c

File tree

3 files changed

+508
-296
lines changed

3 files changed

+508
-296
lines changed

README.md

Lines changed: 61 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
11
# pingerr
22

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.
44

55
## Features
66

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)
910
- **DNS-Ping Correlation Analysis**: Measures both DNS query time and network latency
1011
- **Smart Scoring System**: Weighted scoring (70% DNS, 30% ping) for optimal server selection
1112
- **Color-Coded Results**: Visual indicators for performance (Green = Excellent, Yellow = Good, Red = Slow)
1213
- **Configuration Recommendations**: Provides ready-to-use primary and secondary DNS suggestions
1314

14-
## What It Tests
15+
## How It Works
1516

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.
2226

2327
## Videos
2428
### Demo Videos
@@ -81,6 +85,46 @@ chmod +x /tmp/pingerr_ash.sh
8185
/tmp/pingerr_ash.sh
8286
```
8387

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+
84128
## Prerequisites
85129

86130
### For Regular Systems
@@ -117,7 +161,7 @@ opkg install drill
117161
The script provides a complete ranking of all tested DNS servers:
118162
```
119163
┌──────┬──────────────────────────────────────┬───────────────────────┬───────────┐
120-
│ Rank │ DNS Server │ IP Address │ Avg Time
164+
│ Rank │ DNS Server │ IP Address │ Median
121165
├──────┼──────────────────────────────────────┼───────────────────────┼───────────┤
122166
│ 1 │ Cloudflare-Primary │ 1.1.1.1 │ 12 ms │
123167
│ 2 │ Google-Primary │ 8.8.8.8 │ 15 ms │
@@ -180,25 +224,22 @@ System Preferences > Network > Advanced > DNS
180224
181225
🏆 BEST DNS SERVER: Cloudflare-Primary
182226
IP Address: 1.1.1.1
183-
Average Response Time: 12 ms
227+
Median Response Time: 12 ms
184228
185229
CONFIGURATION RECOMMENDATION:
186230
Primary DNS: 1.1.1.1 (Cloudflare-Primary - 12ms)
187231
Secondary DNS: 8.8.8.8 (Google-Primary - 15ms)
188232
```
189233

190-
# Advanced Options
234+
## Advanced Usage
191235

192-
### Modify Test Parameters
236+
### Modify DNS Server List
193237

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).
198239

199-
### Run Specific Tests Only
240+
### IPv6 Testing
200241

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.
202243

203244
## Troubleshooting
204245

0 commit comments

Comments
 (0)