从3秒上看到一则消息
《Google的20%项目让你的网速达到极限》
文中提及的工具Namebench,非常好使,几分钟时间就找到好几个dns,速度在最快是51毫秒,换上新DNS之后效果那是立竿见影。
下面简单介绍一下
环境
os:ubuntu 9.10
python 2.6.4
1.安装
在谷歌官网上可以下载源码包
http://code.google.com/p/namebench/downloads/list
目前支持windows,mac osx和linux,下载 namebench-1.1.tgz文件,解压缩之后,里面的namebench.py就是我们要执行的文件了。
2.执行
jim@jim-laptop:~ $ ./namebench.py - python-tk (tkinter) libraries are missing, falling back to command-line interface. namebench 1.1 - data/alexa-top-10000-global.txt (weighted) on 2010-01-07 19:15:02.874698 threads=45 tests=200 runs=1 timeout=2.0 health_timeout=3.5 servers=11 ------------------------------------------------------------------------------ - Checking query interception status... - Checking connection quality: 1/2..2/2 - Congestion level is 4.61X (check duration: 184.20ms) - Applied 3.00X timeout multiplier due to congestion: 6.0 standard, 10.5 health. - Checking latest sanity reference - Checking nameserver health - Building initial DNS cache for 3236 nameservers [45 threads] - Checking nameserver availability: 0/3236.......................................................................................................................... * OpenDNS-2 [208.67.222.222] failed test #1/2: TestRootServerResponse: a.root-servers.net.: Timeout ................................................................................................................................................................................................................................663............................................................................................. * UltraDNS [156.154.70.1] failed test #1/2: TestRootServerResponse: a.root-servers.net.: Timeout ......................................................................................................................................................................................................................................... * DynGuide [216.146.35.35] failed test #1/2: TestRootServerResponse: a.root-servers.net.: Timeout ..............................1316..................................................................................................................................................................................................... * UltraDNS-2 [156.154.71.1] failed test #1/2: TestRootServerResponse: a.root-servers.net.: Timeout .................................................................................................................................................................1974.............................................................................................................................................................................................................................................................................................................................................................2631.................................................................................................................................................................................................................................................................... * DynGuide-2 [216.146.36.36] failed test #1/2: TestRootServerResponse: a.root-servers.net.: Timeout ......................................................................3236/3236 - 563 of 3236 name servers are available - Running initial health checks on 563 servers: 0/563.......... * Google Public DNS-2 [8.8.4.4] failed test #1/2: TestLocalhostResponse: localhost.: Timeout * Google Public DNS [8.8.8.8] failed test #1/2: TestLocalhostResponse: localhost.: Timeout ................................. * OpenDNS-2 [208.67.222.222] failed test #2/2: TestLocalhostResponse: localhost.: Timeout .......................115..................................... * Google Public DNS-2 [8.8.4.4] failed test #2/2: www.facebook.com.: www.facebook.com.: Timeout * Google Public DNS [8.8.8.8] failed test #2/2: www.facebook.com.: www.facebook.com.: Timeout .............................234.............................. * DynGuide-2 [216.146.36.36] failed test #2/2: TestLocalhostResponse: localhost.: Timeout ......................................348... * UltraDNS [156.154.70.1] failed test #2/2: TestLocalhostResponse: localhost.: Timeout .............................. * DynGuide [216.146.35.35] failed test #2/2: TestLocalhostResponse: localhost.: Timeout ..... * UltraDNS-2 [156.154.71.1] failed test #2/2: TestLocalhostResponse: localhost.: Timeout ............................463....................... * OpenDNS [208.67.220.220] failed test #1/2: TestLocalhostResponse: localhost.: Timeout ................................... * OpenDNS [208.67.220.220] failed test #2/2: www.facebook.com.: www.facebook.com.: Timeout .563/563 - Demoting Google Public DNS-2 to alternate anycast. Google Public DNS is faster by 4.48ms - Demoting OpenDNS-2 to alternate anycast. OpenDNS is faster by -238.73ms - Demoting UltraDNS-2 to alternate anycast. UltraDNS is faster by 2.38ms - Demoting DynGuide-2 to alternate anycast. DynGuide is faster by 1.42ms - Picking 21 secondary servers to use (10 nearest, 11 fastest) - Waiting for wildcard cache queries from 22 servers: 0/26........16....23..26/26 - Waiting 4s for TTL's to decrement. - Running cache-sharing checks on 22 servers: 0/462x............................x......................99..................................x..................200x....................x..............x...................304x..................x.............................397............................x.x.x.xx.x.x.x.xxx..x.462/462 - Picking 10 secondary servers to use (5 nearest, 5 fastest) - Zjtietong 1 CN [222.46.120.5] appears to be the nearest regional (31.79ms) - Running final health checks on 11 servers: 0/15........15/15 ist of nameservers considered: ------------------------------------------------------------------------------ 192.168.0.1 Internal 192-0-1 42 ms | Incorrect result for www.facebook.com.: 93.46.8.89 222.46.120.5 Zjtietong 1 CN 51 ms | Incorrect result for twitter.com.: 8.7.198.45, Incorrect result for www.facebook.com.: 159.106.121.75 210.22.70.3 cncnet chj.sh CN 82 ms | Incorrect result for twitter.com.: 8.7.198.45, Incorrect result for www.facebook.com.: 243.185.187.39 211.78.130.1 Sparqnet TW 93 ms | (excluded: twitter.com.: None) 202.145.138.1 TTN TW 100 ms | Incorrect result for www.facebook.com.: 46.82.174.68, Incorrect result for twitter.com.: 78.16.49.15 61.135.159.46 Tom CN 122 ms | Incorrect result for www.facebook.com.: 203.98.7.65, Incorrect result for twitter.com.: 8.7.198.45 203.253.31.1 Soongsil Uni KR 134 ms | Incorrect result for twitter.com.: 159.106.121.75, Incorrect result for www.facebook.com.: 8.7.198.45 202.6.233.11 Padinet ID 142 ms | Incorrect result for www.facebook.com.: 37.61.54.158, Incorrect result for twitter.com.: 8.7.198.45 203.118.99.3 ClickMeUp TH 156 ms | (excluded: twitter.com.: None) 203.133.1.8 GIGA-Net TW 176 ms | Incorrect result for www.facebook.com.: 8.7.198.45, Incorrect result for twitter.com.: 37.61.54.158 204.153.24.1 INFOTEC MX 362 ms | Incorrect result for www.facebook.com.: 59.24.3.173, Incorrect result for twitter.com.: 203.98.7.65 8.8.8.8 Google Public DNS 10830ms | (excluded: www.facebook.com.: www.facebook.com.: Timeout ) 208.67.220.220 OpenDNS 10840ms | (excluded: www.facebook.com.: www.facebook.com.: Timeout ) 156.154.70.1 UltraDNS 16140ms | (excluded: TestLocalhostResponse: localhost.: Timeout ) 216.146.35.35 DynGuide 16142ms | (excluded: TestLocalhostResponse: localhost.: Timeout ) - Creating test records using weighted - Reading test data from data/alexa-top-10000-global.txt - Benchmarking 9 server(s), run 1 of 1: 1/200.........................................41.........................................82.........................................123.........................................164....................................200/200 Fastest individual response (in milliseconds): ---------------------------------------------- Internal 192-0-1 ################# 18.03398 Tom CN ############################ 30.94196 Zjtietong 1 CN ############################ 30.97701 GIGA-Net TW ######################################## 44.59786 INFOTEC MX ######################################## 44.59810 TTN TW ######################################### 45.74800 Soongsil Uni KR ######################################### 45.88008 cncnet chj.sh CN ################################################## 55.64284 Padinet ID ##################################################### 59.35812 Mean response (in milliseconds): -------------------------------- Zjtietong 1 CN ########### 121.53 Internal 192-0-1 ############## 155.48 cncnet chj.sh CN ################ 168.50 TTN TW ################## 194.85 Tom CN ####################### 250.24 GIGA-Net TW ########################## 282.79 Padinet ID ############################## 330.84 Soongsil Uni KR ################################## 370.85 INFOTEC MX ##################################################### 594.91 Recommended configuration (fastest + nearest): ---------------------------------------------- nameserver 222.46.120.5 # Zjtietong 1 CN Incorrect result for twitter.com.: 8.7.198.45, Incorrect result for www.facebook.com.: 159.106.121.75 nameserver 192.168.0.1 # Internal 192-0-1 Incorrect result for www.facebook.com.: 93.46.8.89 nameserver 61.135.159.46 # Tom CN Incorrect result for www.facebook.com.: 203.98.7.65, Incorrect result for twitter.com.: 8.7.198.45 ******************************************************************************** In this test, Zjtietong 1 CN is 27.9% faster than your current primary DNS server ******************************************************************************** - Saving HTML report to /tmp/namebench_2010-01-07_1939.html - Saving query details (CSV) to /tmp/namebench_2010-01-07_1939.csv jim@jim-laptop:~ $
最后考虑到速度和距离远近,程序还推荐了三个dns(第一个从名字上来看应该是铁通的DNS,但并不是本人ADSL自动获取的DNS),用上之后果然速度飞快。
