`curl -L` 解决 GitHub 的 raw.githubusercontent.com 无法连接问题

时间:2020-10-24 09:48:51   收藏:0   阅读:57

解决 GitHub 的 raw.githubusercontent.com 无法连接问题

在使用 curl 下载文件时,如果出现以下情况

curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused

估计是 Github 的 raw 文件读取地址遭受了 DNS 污染,链接贼慢

查询 raw.githubusercontent.com 的 IP

修改 hosts 文件

文件路径 /etc/hosts

添加以下内容

# GitHub Start
52.74.223.119 github.com
192.30.253.112 gist.github.com
192.30.253.113 gist.github.com
192.30.253.119 gist.github.com
54.169.195.247 api.github.com
185.199.111.153 assets-cdn.github.com
151.101.76.133 raw.githubusercontent.com
151.101.108.133 user-images.githubusercontent.com
151.101.76.133 gist.githubusercontent.com
151.101.76.133 cloud.githubusercontent.com
151.101.76.133 camo.githubusercontent.com
151.101.185.194 github.global.ssl.fastly.net
# GitHub End

The_End

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!