GitHub页面无法访问的常见原因

108 阅读1分钟

GitHub页面无法访问的常见原因括网络限制、DNS解析异常或Hosts文件配置错误

 DNS解析优化

  1. 清除DNS缓存‌:

    • Windows:ipconfig /flushdns
    • macOS/Linux:sudo dscacheutil -flushcache 或 sudo systemd-resolve --flush-caches。 ‌
  2. 手动配置Hosts‌:(亲测有用)

                添加以下IP与域名映射(需通过工具如ping github.com获取最新IP):

                textCopy Code

      140.82.113.3 github.com

      185.199.110.153 assets-cdn.github.com

      185.199.108.133 raw.githubusercontent.com

       文件路径:Windows为C:\Windows\System32\drivers\etc\hosts,Mac/Linux为/etc/hosts

`

3a144c0e-09c8-44ed-8057-0794801be58a.png