V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
gongym
V2EX  ›  推广

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

  •  
  •   gongym · 43 天前 · 681 次点击
    这是一个创建于 43 天前的主题,其中的信息可能已经有所发展或是发生改变。

    说明

    一个小工具,用于向 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 条附言  ·  43 天前
    不好意思,没法项目地址

    https://github.com/ggymm/auto-hosts
    4 条回复    2024-08-04 21:19:34 +08:00
    vokins
        1
    vokins  
       43 天前 via iPhone
    在哪下载啊?
    miaomiao888
        2
    miaomiao888  
       43 天前
    这些 DNS 都是以非加密的 UDP 协议查询吗,是的话解析某些污染域名可能不行。
    最近正好在想一个问题,有没一种公共 DNS 或本地 DNS 工具可以实现获取一个域名所有的(不同地区)解析结果。
    不是向多个上游查询的那种。
    0o0O0o0O0o
        3
    0o0O0o0O0o  
       43 天前
    @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
       43 天前
    @vokins 不好意思,忘记发项目地址了

    https://github.com/ggymm/auto-hosts
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   885 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 20:08 · PVG 04:08 · LAX 13:08 · JFK 16:08
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.