Cloudflare 今日發佈了極速及私穩優先的 DNS 1.1.1.1 服務,選擇於四月一日 (April Fools) 發佈喺因為 1.1.1.1 有 4 個 1 字,節錄於內文:

we're geeks at heart. 1.1.1.1 has 4 1s. So it seemed clear that 4/1 (April 1st) was the date we needed to launch it.
Never mind that it was a Sunday. Never mind that it was on Easter and during Passover. Never mind that it was April Fools Day — a day where tech companies often trot out fictional services they think are cute while the media and the rest of the non-tech world collectively roll their eyes.

既然唔係流料,事不宜遲,立即黎個實測同 Google 提供的 8.8.8.8 比較下先!

Round 1: Ping Test

測試項目: Ping 10 次
測試目的: 比較兩個 DNS 伺服器與香港的距離

筆者以香港一般家用寬頻進行測試,結果如下:

// Cloudflare
ping -c 10 1.1.1.1
PING 1.1.1.1 (1.1.1.1): 56 data bytes
64 bytes from 1.1.1.1: icmp_seq=0 ttl=59 time=3.182 ms
64 bytes from 1.1.1.1: icmp_seq=1 ttl=59 time=2.888 ms
64 bytes from 1.1.1.1: icmp_seq=2 ttl=59 time=2.411 ms
64 bytes from 1.1.1.1: icmp_seq=3 ttl=59 time=3.674 ms
64 bytes from 1.1.1.1: icmp_seq=4 ttl=59 time=2.448 ms
64 bytes from 1.1.1.1: icmp_seq=5 ttl=59 time=3.045 ms
64 bytes from 1.1.1.1: icmp_seq=6 ttl=59 time=2.840 ms
64 bytes from 1.1.1.1: icmp_seq=7 ttl=59 time=2.908 ms
64 bytes from 1.1.1.1: icmp_seq=8 ttl=59 time=2.984 ms
64 bytes from 1.1.1.1: icmp_seq=9 ttl=59 time=2.469 ms

--- 1.1.1.1 ping statistics ---
10 packets transmitted, 10 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 2.411/2.885/3.674/0.366 ms
// Google
ping -c 10 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=45 time=14.391 ms
64 bytes from 8.8.8.8: icmp_seq=1 ttl=45 time=14.544 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=45 time=14.757 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=45 time=14.724 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=45 time=14.689 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=45 time=14.535 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=45 time=14.660 ms
64 bytes from 8.8.8.8: icmp_seq=7 ttl=45 time=14.377 ms
64 bytes from 8.8.8.8: icmp_seq=8 ttl=45 time=14.784 ms
64 bytes from 8.8.8.8: icmp_seq=9 ttl=45 time=14.739 ms

--- 8.8.8.8 ping statistics ---
10 packets transmitted, 10 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 14.377/14.620/14.784/0.142 ms
  • Cloudflare DNS 1.1.1.1 - Average 2.885ms
  • Google DNS 8.8.8.8 - Average 14.620ms

Cloudflare DNS Server Ping Test Round-trip 能夠做到低於 3ms,証明其中有部份伺服器真係好近香港!

Round 2: Dig Test

測試項目: 連續 dig 10 次找出 blog.gaplotech.com 的 Name server,計算 10 次所需要的總時間
測試目的: 比較 DNS Resolve 的速度

測試使用的 Script (由於 dig 提供嘅 Query Time 只準到 milli-second,未足夠準確,所以要額外用 gdate 去度)

結果如下:

sh dig_test.sh 1.1.1.1
Total Query Time = 93 ms

sh dig_test.sh 8.8.8.8
Total Query Time = 214 ms
  • Cloudflare DNS 1.1.1.1 - Average 9.3ms
  • Google DNS 8.8.8.8 - Average 21.4ms

減去 Ping Test 的時間 (Network latency) 後:

  • Cloudflare DNS 1.1.1.1 - Average 6.415ms
  • Google DNS 8.8.8.8 - Average 6.780ms

兩者速度非常接近,由於測試數值上存在一定誤差,可以當打和,Super!

其它測試數據

一齊再睇下官網提供嘅比較
cloudflare-dns-perf

再睇下 DNSPerf Asia
dns-perf-asia

Build Better Internet

「Build better internet」是 Cloudflare 的中心目標,筆者一直有使用 Cloudflare 的服務,並見証 Cloudflare 不斷提升它們的服務。

Cloudflare 不斷提升服務,再將服務開放給大眾免費使用,把體驗推高去實踐「Build Better Internet」的目標。就效果而言,筆者認為這比 Google 的「Don't be evil」目標更擲地有聲。

雖知道要維護一個全球使用的 Public DNS 服務絕非容易之事,Cloudflare 肯作踏出這一步真的不容易,公司的承擔、執行力及強大的技術團隊缺一不可。

反觀香港創科局目標「通過為政府、業界、學術界及研究界締造一個充滿活力及具備優質軟件及硬件支援的生態系統,我們決意發展香港成為一個知識型經濟體系,以及在科技及其應用上成為區內的創新樞紐」,呢個局既無承擔既無執行力更無自己一個強大的技術團隊,呢幾年做過啲乜野?公共服務技術水平落後,無制定相對政策規管私人集團壟斷式支配公共場所的民生服務(如售票服務),例如線上售票系統必須符合特定的客觀條件:Request/s(RPS) 達到某個數值以上、有效阻止程式自動購買、軟件設計及所使用的硬件能應付至少人口的十分一峰值流量、SLA 至少有要 99.9% ⋯⋯等等的技術條件,才可以為公共場所售票。

公帑多的是,何不政府帶頭打造滲透全港生活的高質素線上及線下系統,從而「締造一個充滿活力及具備優質軟件及硬件支援的生態系統」去推動香港週邊的 IT 業務呢?

總結

筆者原本大部份裝置都使用 8.8.8.8 的 DNS 服務,但今次由於 Cloudflare DNS 的 Network Latency 比較 Google 的低非常多。效能先決的筆者已將恆常使用的裝置由 8.8.8.8 轉到 1.1.1.1 體驗一下。

另外,幸好香港暫時仲未聽過有嚴重的 DNS Privacy 或 Censorship 問題,例如話某某香港 ISP 預設提供的 DNS 因某些政治原因而封閉某些網站,令使用該 DNS 的用戶不能正常瀏灠那些網站;有與趣閱讀相關課題的朋友可以參閱原文 Announcing 1.1.1.1: the fastest, privacy-first consumer DNS service

下次有香港 ISP DNS Server 冧檔時,記得介紹 1.1.1.1 比朋友喇!

唔識 Setup DNS?
Cloudflare 於 https://1.1.1.1/#setup-instructions 提供完整的教學影片,教學包括 iPhone、Android、MacOS、Windows、Linux、General Router,立即為你的裝置設定 1.1.1.1 DNS 服務感受更流暢的上網體驗!