Created
January 3, 2017 07:28
-
-
Save honwen/cbf79dd89c85d45f6883025520b5e691 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
port=$1 | |
if [ "Z$port" = "Z" ]; then port=443; fi | |
curl -sSL https://dns.d0wn.biz/ | sed -n 's/^IPv4[^0-9]*//p' | while read dns; do | |
printf "%-16s # %-5s " $dns $port | |
tm=$( dig +time=1 +tries=3 -p$port +tcp google.com @$dns 2>/dev/null | sed -n 's/.*time: //p') | |
if [ "Z$tm" = "Z" ]; then echo -n " : X \t" ; else echo -n " : $tm \t"; fi | |
if hash ip2loc 2>/dev/null; then ip2loc $dns | sed 's/ N.*//g'; fi | |
done | |
exit 0 | |
================================ | |
37.187.0.40 # 5353 : 352 msec 法国 法国 | |
128.199.248.105 # 5353 : 61 msec 新加坡 新加坡 | |
95.85.9.86 # 5353 : 304 msec 荷兰 荷兰 | |
185.83.217.248 # 5353 : 293 msec 荷兰 荷兰 | |
82.211.31.248 # 5353 : 289 msec 德国 德国 | |
178.17.170.67 # 5353 : 333 msec 摩尔多瓦 摩尔多瓦 | |
91.214.71.181 # 5353 : 357 msec 俄罗斯 俄罗斯 | |
217.12.210.54 # 5353 : X 乌克兰 乌克兰 | |
217.12.203.133 # 5353 : 305 msec 保加利亚 保加利亚 | |
77.66.108.93 # 5353 : 308 msec 丹麦 丹麦 | |
81.2.237.32 # 5353 : 300 msec 捷克 捷克 | |
31.14.133.188 # 5353 : 299 msec 意大利 意大利 | |
178.17.170.133 # 5353 : 330 msec 摩尔多瓦 摩尔多瓦 | |
185.14.29.140 # 5353 : 319 msec 荷兰 荷兰 | |
41.79.69.13 # 5353 : 432 msec 坦桑尼亚 坦桑尼亚 | |
85.25.105.193 # 5353 : 318 msec 法国 法国 | |
89.111.13.60 # 5353 : 335 msec 拉脱维亚 拉脱维亚 | |
77.81.104.121 # 5353 : 315 msec 罗马尼亚 罗马尼亚 | |
37.235.49.61 # 5353 : 339 msec 冰岛 冰岛 | |
185.137.15.105 # 5353 : 326 msec 德国 德国 | |
95.215.44.124 # 5353 : 349 msec 瑞典 瑞典 | |
185.86.151.28 # 5353 : 343 msec 拉脱维亚 拉脱维亚 | |
185.121.25.85 # 5353 : 297 msec 英国 英国 | |
213.169.148.11 # 5353 : 364 msec 塞浦路斯 塞浦路斯 | |
210.16.120.139 # 5353 : 71 msec 新加坡 新加坡 | |
45.124.66.200 # 5353 : 34 msec 中国 香港 | |
185.133.72.116 # 5353 : 287 msec 荷兰 荷兰 | |
27.100.36.191 # 5353 : 271 msec 澳大利亚 澳大利亚 | |
151.80.7.115 # 5353 : 297 msec 法国 法国 | |
91.142.220.29 # 5353 : 350 msec 西班牙 西班牙 | |
107.181.187.219 # 5353 : 179 msec 美国 美国 | |
194.135.95.138 # 5353 : 304 msec 立陶宛 立陶宛 | |
192.252.222.24 # 5353 : 235 msec 美国 美国 | |
79.133.33.52 # 5353 : 279 msec 奥地利 奥地利 | |
45.114.118.195 # 5353 : 84 msec 印度尼西亚 印度尼西亚 | |
185.128.42.123 # 5353 : 345 msec 瑞士 瑞士 | |
198.50.244.26 # 5353 : 285 msec 加拿大 加拿大 | |
23.88.53.222 # 5353 : 146 msec 美国 美国 | |
103.214.68.250 # 5353 : 73 msec 韩国 韩国 | |
103.27.124.66 # 5353 : 23 msec 中国 香港 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment