第一步,查GitHub的ip
查询http://github.global.ssl.fastly.net和http://github.com分别发现对应的ip如下:
199.232.69.194 http://github.global.ssl.fastly.net
140.82.112.3 http://github.com
第二步,hosts文件中添加
windows系统的hosts文件的位置如下:
C:\Windows\System32\drivers\etc\hosts
把hosts文件复制到桌面,并用txt打开,再最后添加三行
# github
199.232.69.194 http://github.global.ssl.fastly.net
140.82.112.3 http://github.com
再替换到C:\Windows\System32\drivers\etc\hosts
第三步,刷新 DNS 缓存
在终端或CMD中,执行以下命令:
ipconfig /flushdns