Failed to connect to github.com port 443: Operation timed out

最近使用Pod安装库出现

Failed to connect to github.com port 443: Operation timed out


image.png

在终端ping github.com 也是ping不通一直丢包


image.png

然后查看了下hosts文件 (sudo nano /private/etc/hosts)


image.png

看是没什么问题,但确实ip已经变了。

解决方法:
到 ipaddress.com 查询hosts文件内配置的域名对应的ip
最终将hosts文件内对应的修改为:

140.82.113.4 github.com 
199.232.69.194 github.global.ssl.fastly.net
199.232.68.133 assets-cdn.github.com
199.232.68.133 avatars0.githubusercontent.com
199.232.68.133 avatars1.githubusercontent.com

成功:


image.png

你可能感兴趣的:(Failed to connect to github.com port 443: Operation timed out)