GitHub页面无法访问的常见原因括网络限制、DNS解析异常或Hosts文件配置错误
DNS解析优化
-
清除DNS缓存:
- Windows:
ipconfig /flushdns - macOS/Linux:
sudo dscacheutil -flushcache或sudo systemd-resolve --flush-caches。
- Windows:
-
手动配置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
`