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

ubuntu18.04报错,raw.githubusercontent.com无法连接

1. IP查询:

https://www.ip138.com/.
去这个网站,查询无法连接网址的IP地址

在终端里ping这个网址原来是ping不通的
(ping的使用方法,终端输入 $ ping www.baidu.com
最后我得到的是:
151.101.84.133
以下是网上找的一些说不定用得到的网址IP:

IP网址
52.74.223.119right-aligned github.com
192.30.253.119gist.github.com
54.169.195.247api.github.com
185.199.111.153assets-cdn.github.com
151.101.76.133 这个地方76在我电脑上得改成84raw.githubusercontent.com
151.101.108.133user-images.githubusercontent.com
151.101.76.133gist.githubusercontent.com
151.101.76.133cloud.githubusercontent.com
151.101.76.133camo.githubusercontent.com
151.101.76.133avatars0.githubusercontent.com
151.101.76.133avatars1.githubusercontent.com
151.101.76.133avatars2.githubusercontent.com
151.101.76.133avatars3.githubusercontent.com
151.101.76.133avatars4.githubusercontent.com
151.101.76.133avatars5.githubusercontent.com
151.101.76.133avatars6.githubusercontent.com
151.101.76.133avatars7.githubusercontent.com
151.101.76.133avatars8.githubusercontent.com

2.修改hosts

Hosts是一个没有扩展名的系统文件,可以用记事本等工具打开,其作用就是将一些常用的网址域名与其对应的IP地址建立一个关联“数据库”,当用户在浏览器中输入一个需要登录的网址时,系统会首先自动从Hosts文件中寻找对应的IP地址,一旦找到,系统会立即打开对应网页,如果没有找到,则系统会再将网址提交DNS域名解析服务器进行IP地址的解析。

sudo vi /etc/hosts
sudo vim /etc/hosts
sudo gedit /etc/hosts

上面三条指令都是OK的,看你使用什么编辑器,本质上是修改hosts文件,加上我们之前查到的那个IP地址
添加下面代码至hosts

151.101.84.133  raw.githubusercontent.com

理论上现在就可以ping成功那个网址了,报错解决!

  • 4
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值