使用dig,grep,sort查找最快的免费DNS服务器

・1 分钟阅读

查找最快的免费DNS服务器的函数

timeDNS() { parallel -j0 --tag dig @{}"$*" ::: 208.67.222.222 208.67.220.220 198.153.192.1 198.153.194.1 156.154.70.1 156.154.71.1 8.8.8.8 8.8.4.4 | grep Query | sort -nk5; }
使用GNU并行,
示例输出
208.67.222.222 ;; Query time: 18 msec
208.67.220.220 ;; Query time: 18 msec
198.153.194.1 ;; Query time: 22 msec
8.8.8.8 ;; Query time: 14 msec
8.8.4.4 ;; Query time: 18 msec
156.154.70.1 ;; Query time: 27 msec
198.153.192.1 ;; Query time: 42 msec
156.154.71.1 ;; Query time: 33 msec
Hujiuxiang profile image