目录

GitHub又打不开了

目录

GitHub又打不开了?

https://i-operation.csdnimg.cn/images/cf31225e169b4512917b2e77694eb0a2.pngGitHub无法访问?本地Hosts修复指南

Localhost修改(最硬核)

功能用法:

  1. 查询GitHub官方IP:访问 ipaddress.com 搜索github.com和assets-cdn.github.com
    2https://i-blog.csdnimg.cn/direct/7bb337e2ec7c4be8a88c547675cb1f7f.png
  2. 打开Hosts文件: ◦ Windows:C:\Windows\System32\drivers\etc\hosts(需管理员权限)

◦ Mac/Linux:终端输入sudo nano /etc/hosts

  1. 添加解析记录(示例):
    140.82.114.4 github.com 199.232.69.194 github.global.ssl.fastly.net
  2. 刷新DNS缓存: ◦

Windows:ipconfig /flushdns
https://i-blog.csdnimg.cn/direct/e85581d114ef4c8aa237f213922800e5.png

◦ Mac/Linux:sudo killall -HUP mDNSResponder

⚠️注意:IP地址可能变化,建议每月更新一次