国内因为某些问题,会屏蔽国外一些网站。有时GitHub访问的时候会出现错误,无法访问。解决办法:
1、进入https://fastly.net.ipaddress.com/(全球最好的IP地址查询工具)
查询 github.com
与 github.global.ssl.fastly.net
2、修改host文件
Windows
文件路径 C:\Windows\System32\drivers\etc\host
#添加以下内容
140.82.114.4 github.com
199.232.69.194 github.global.ssl.fastly.net
Linux
#终端输入
vi /etc/hosts
#按 i 进入编辑模式,插入如下文本
140.82.114.4 github.com
199.232.69.194 github.global.ssl.fastly.net
#按Esc键退出编辑模式,输入:wq!保存退出
3、更新dns缓存
# Windows打开CMD运行如下命令
ipconfig /flushdns
# Linux重启机器或者重启服务使Hosts生效,这块我没啥也没重启 ,测试感觉就好了。