1. 程式人生 > >這可能是目前最好用DNS診斷和性能測量工具

這可能是目前最好用DNS診斷和性能測量工具

3.5 block name quest byte diag 數據 flag 好用

dnsping

通過給DNS服務器發送指定的數據包,像PING一樣返回結果

 dnsping -c 10 -s 114.114.114.114 www.51cto.com 
dnsping DNS: 114.114.114.114:53, hostname: www.51cto.com, rdatatype: A
70 bytes from 114.114.114.114: seq=0   time=26.055 ms
70 bytes from 114.114.114.114: seq=1   time=24.745 ms
70 bytes from 114.114.114.114: seq=2   time=24.468 ms
70 bytes from 114.114.114.114: seq=3   time=25.033 ms
70 bytes from 114.114.114.114: seq=4   time=24.615 ms
70 bytes from 114.114.114.114: seq=5   time=24.844 ms
70 bytes from 114.114.114.114: seq=6   time=27.036 ms
70 bytes from 114.114.114.114: seq=7   time=25.232 ms
70 bytes from 114.114.114.114: seq=8   time=25.613 ms
70 bytes from 114.114.114.114: seq=9   time=25.343 ms

--- 114.114.114.114 dnsping statistics ---
10 requests transmitted, 10 responses received, 0% lost
min=24.468 ms, avg=25.298 ms, max=27.036 ms, stddev=0.777 ms

通過114公共DNS解析51cto官網,解析時間平均為25ms

測試內部的DNS,因為緩存的關系,會更快

dnsping -c 10 -s 192.168.x.x www.51cto.com
dnsping DNS: 192.168.x.x:53, hostname: www.51cto.com, rdatatype: A
71 bytes from 192.168.x.x: seq=0   time=84.492 ms
71 bytes from 192.168.x.x: seq=1   time=3.628 ms
71 bytes from 192.168.x.x: seq=2   time=3.340 ms
71 bytes from 192.168.x.x: seq=3   time=3.204 ms
71 bytes from 192.168.x.x: seq=4   time=3.350 ms
71 bytes from 192.168.x.x: seq=5   time=3.198 ms
71 bytes from 192.168.x.x: seq=6   time=3.164 ms
71 bytes from 192.168.x.x: seq=7   time=3.209 ms
71 bytes from 192.168.x.x: seq=8   time=3.059 ms
71 bytes from 192.168.x.x: seq=9   time=3.051 ms

--- 192.168.x.x dnsping statistics ---
10 requests transmitted, 10 responses received, 0% lost
min=3.051 ms, avg=11.369 ms, max=84.492 ms, stddev=25.693 ms

地址要自豪的隱藏,不過可以看出除了第一次要去上聯取解析時間較久外,後面因為緩存的關系解析速度是很快的。

dnstraceroute

像traceroute路由探測一樣,用來確定你的DNS請求經過的路徑到達目的地

這裏開啟--expert選項可以輸出專業提示,例如有可能DNS流暢劫持。很不幸看看我的結果,這次我用了阿裏雲的公共DNS

dnstraceroute --expert -C -t A -s 223.5.5.5  www.51cto.com
dnstraceroute DNS: 223.5.5.5:53, hostname: www.51cto.com, rdatatype: A

9      61.51.113.81 (61.51.113.81) 3.487 ms
10     192.168.9.22 (192.168.9.22) 174.075 ms
11     61.49.143.214 (61.49.143.214) 5.115 ms
12     192.168.9.22 (192.168.9.22) 168.890 ms
13     140.205.26.210 (140.205.26.210) 42.070 ms
14     192.168.9.22 (192.168.9.22) 132.504 ms
15     192.168.9.22 (192.168.9.22) 131.364 ms
16     192.168.9.22 (192.168.9.22) 130.170 ms
17     192.168.9.22 (192.168.9.22) 129.046 ms
18     192.168.9.22 (192.168.9.22) 128.409 ms
19     192.168.9.22 (192.168.9.22) 127.440 ms
20     192.168.9.22 (192.168.9.22) 126.075 ms
21     192.168.9.22 (192.168.9.22) 124.876 ms
22     192.168.9.22 (192.168.9.22) 123.502 ms
23     192.168.9.22 (192.168.9.22) 122.405 ms
24     192.168.9.22 (192.168.9.22) 121.296 ms
25     192.168.9.22 (192.168.9.22) 120.340 ms
26     192.168.9.22 (192.168.9.22) 121.284 ms
27     192.168.9.22 (192.168.9.22) 120.235 ms
28     192.168.9.22 (192.168.9.22) 119.002 ms
29     192.168.9.22 (192.168.9.22) 117.941 ms
30     192.168.9.22 (192.168.9.22) 116.735 ms

=== Expert Hints ===
 [*] public DNS server is next to a private IP address (possible hijacking)

前面8跳我進行了隱藏,後面的,我就不多說了。

dnseval

用於同時比較多個DNS服務器的響應時間,非常實用

dnseval -t A -f /root/dnsdiag/public-servers.txt -c10 www.51cto.com 
server              avg(ms)     min(ms)     max(ms)     stddev(ms)  lost(%)  ttl        flags
-----------------------------------------------------------------------------------------
114.114.114.114     25.257      24.925      27.023      0.631       %0       38         QR -- -- RD RA -- --
223.5.5.5           42.854      40.213      56.995      5.080       %0       15         QR -- -- RD RA -- --
223.6.6.6           43.564      39.979      48.332      2.775       %0       15         QR -- -- RD RA -- --
123.123.123.124     11.678      6.330       26.417      6.254       %0       60         QR -- -- RD RA -- --
123.125.81.6        4.015       3.234       6.977       1.121       %0       223        QR -- -- RD RA -- --
180.76.76.76        10.505      5.159       39.302      10.410      %0       80         QR -- -- RD RA -- --

感謝51CTO,我又拿它做測試了


最後附帶官方地址,下載、安裝請自行參考。
官方地址

這可能是目前最好用DNS診斷和性能測量工具