推广一个探测 IP 配置 Hosts 的小工具 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
gongym
V2EX    推广

推广一个探测 IP 配置 Hosts 的小工具

  •  
  •   gongym 2024-08-04 19:20:49 +08:00 1195 次点击
    这是一个创建于 517 天前的主题,其中的信息可能已经有所发展或是发生改变。

    说明

    一个小工具,用于向 dns 服务器查询域名解析的 ip 并自动检测 ip 的延时

    使用场景比较有限。

    推荐自行编译并且配置好需要查询的域名

    流程

    1. 根据域名,到 DNS 服务器解析出 A 类 IP 地址
    2. 对解析出的 IP 地址使用 PING 命令检查延时
    3. 选择延时最低的 IP 地址,最终生成 hosts 文件

    hosts

    140.82.113.26 alive.github.com 20.27.177.116 api.github.com 185.199.108.153 assets-cdn.github.com 185.199.110.133 avatars.githubusercontent.com 185.199.109.133 avatars0.githubusercontent.com 185.199.109.133 avatars1.githubusercontent.com 185.199.109.133 avatars2.githubusercontent.com 185.199.109.133 avatars3.githubusercontent.com 185.199.109.133 avatars4.githubusercontent.com 185.199.110.133 avatars5.githubusercontent.com 185.199.108.133 camo.githubusercontent.com 140.82.112.21 central.github.com 185.199.109.133 cloud.githubusercontent.com 20.27.177.114 codeload.github.com 140.82.112.21 collector.github.com 185.199.110.133 desktop.githubusercontent.com 185.199.110.133 favicons.githubusercontent.com 243.185.187.39 gist.github.com 52.217.235.225 github-cloud.s3.amazonaws.com 54.231.136.169 github-com.s3.amazonaws.com 16.182.72.57 github-production-release-asset-2e65be.s3.amazonaws.com 52.217.113.65 github-production-repository-file-5c1aeb.s3.amazonaws.com 54.231.137.161 github-production-user-asset-6210df.s3.amazonaws.com 192.0.66.2 github.blog 20.27.177.113 github.com 140.82.113.17 github.community 185.199.110.154 github.githubassets.com 151.101.37.194 github.global.ssl.fastly.net 185.199.110.153 github.io 185.199.108.133 github.map.fastly.net 185.199.110.153 githubstatus.com 140.82.113.26 live.github.com 185.199.109.133 media.githubusercontent.com 185.199.108.133 objects.githubusercontent.com 13.107.42.16 pipelines.actions.githubusercontent.com 185.199.109.133 raw.githubusercontent.com 185.199.110.133 user-images.githubusercontent.com 185.199.110.133 private-user-images.githubusercontent.com 13.107.246.64 vscode.dev 140.82.112.21 education.github.com 

    依赖库

    dns

    ping

    govcl

    DNS 服务器

    1.1.1.1 1.2.4.8 4.2.2.1 8.8.8.8 8.20.247.20 8.26.56.26 9.9.9.9 45.11.45.11 64.6.64.6 74.82.42.42 77.88.8.8 80.80.80.80 84.200.69.80 94.140.14.14 101.101.101.101 101.226.4.6 114.114.114.114 119.29.29.29 156.154.70.1 168.126.63.1 180.76.76.76 180.184.1.1 182.254.118.118 185.222.222.222 195.46.39.39 199.85.126.10 202.120.2.100 208.67.222.222 210.2.4.8 223.5.5.5 

    软件截图

    image

    第 1 条附言    2024-08-04 21:19:10 +08:00
    不好意思,没法项目地址

    https://github.com/ggymm/auto-hosts
    4 条回复    2024-08-04 21:19:34 +08:00
    vokins
        1
    vokins  
       2024-08-04 20:38:58 +08:00 via iPhone
    在哪下载啊?
    miaomiao888
        2
    miaomiao888  
       2024-08-04 20:40:55 +08:00
    这些 DNS 都是以非加密的 UDP 协议查询吗,是的话解析某些污染域名可能不行。
    最近正好在想一个问题,有没一种公共 DNS 或本地 DNS 工具可以实现获取一个域名所有的(不同地区)解析结果。
    不是向多个上游查询的那种。
    0o0O0o0O0o
        3
    0o0O0o0O0o  
       2024-08-04 21:02:16 +08:00
    @miaomiao888 #2 我可以想到两种办法:

    1. 用多点 ping 工具网站
    2. 用 client subnet 查询

    ```
    q A google.com @https://149.112.112.11 --subnet=15.230.102.0/24
    q A google.com @https://149.112.112.11 --subnet=150.222.78.0/24
    ```

    q 是 https://github.com/natesales/q
    149.112.112.11 是 quad9 dns
    subnet 分别是美国和新加坡的一个 cidr
    gongym
        4
    gongym  
    OP
       2024-08-04 21:19:34 +08:00
    @vokins 不好意思,忘记发项目地址了

    https://github.com/ggymm/auto-hosts
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     5067 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 1176ms UTC 01:28 PVG 09:28 LAX 17:28 JFK 20:28
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86