正在加载···
AI摘要
HunYuan-Lite

由于 DNS 污染,国内访问 Github 速度非常慢甚至完全无法访问,通过修改 Windows 本地的 hosts 文件可以解决这个问题。

  1. 根据 https://www.itdog.cn/ping/github.com 的检测结果,选择响应时间较快的解析IP,如:

    响应IP IP位置
    20.27.177.113 日本/东京/microsoft.com
    20.200.245.247 韩国/首尔/microsoft.com
    20.205.243.166 新加坡/microsoft.com
    4.237.22.38 澳大利亚/新南威尔士州/悉尼/microsoft.com
    20.26.156.215 英国/伦敦/microsoft.com
    140.82.121.4 德国/黑森/法兰克福/github.com
    20.87.245.0 南非/豪登/约翰内斯堡/microsoft.com
    140.82.116.4 美国/加利福尼亚/旧金山/github.com
    140.82.113.4 美国/弗吉尼亚/阿什本/github.com
    66.220.148.145 美国/俄勒冈/普赖恩维尔/facebook.com
    4.228.31.150 美国/丹佛/microsoft.com
  2. 使用管理员权限修改 C:\Windows\System32\drivers\etc\ 目录下的 hosts 文件,在其末尾添加一行 DNS 映射配置,如 20.27.177.113    github.com ,保存文件

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    # Copyright (c) 1993-2009 Microsoft Corp.
    #
    # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
    #
    # This file contains the mappings of IP addresses to host names. Each
    # entry should be kept on an individual line. The IP address should
    # be placed in the first column followed by the corresponding host name.
    # The IP address and the host name should be separated by at least one
    # space.
    #
    # Additionally, comments (such as these) may be inserted on individual
    # lines or following the machine name denoted by a '#' symbol.
    #
    # For example:
    #
    # 102.54.94.97 rhino.acme.com # source server
    # 38.25.63.10 x.acme.com # x client host

    # localhost name resolution is handled within DNS itself.
    # 127.0.0.1 localhost
    # ::1 localhost

    20.27.177.113 github.com
  3. 打开 Windows 命令行窗口,运行 ipconfig/flushdns 刷新 DNS 缓存