1.问题
使用curl
下载github资源时报错如下:
Failed to connect to raw.githubusercontent.com port 443: 拒绝连接
2.分析
GitHub的 raw.githubusercontent.com 域名解析被污染了,没有正确被定向。
3.解决
只需要在hosts文件中进行指定即可。
3.1 查询网站的真实IP
你可以访问https://ipaddress.com/website/raw.githubusercontent.com
查看真实IP。
3.2 编辑hosts文件
sudo vim /etc/hosts
添加几条解析数据
185.199.108.133 raw.githubusercontent.com
185.199.109.133 raw.githubusercontent.com
185.199.110.133 raw.githubusercontent.com
185.199.111.133 raw.githubusercontent.com
然后:wq!
保存。
再重新试一下,可以了。
评论区