解决github图片不显示的问题,亲测有效

关于Github上头像和文档中各类图片不显示加载不出来的问题解决办法

解决办法一

修改本地的hosts文件
打开路径 C:\Windows\System32\drivers\etc\hosts

可用记事本或者VSCode或者其他编译器(没试过,vscode亲测有效)在文件末尾添加:

# GitHub Start
192.30.253.112    Build software better, together
192.30.253.119     gist.github.com
151.101.184.133     assets-cdn.github.com
151.101.184.133     raw.githubusercontent.com
151.101.184.133     gist.githubusercontent.com
151.101.184.133     cloud.githubusercontent.com
151.101.184.133     camo.githubusercontent.com
151.101.184.133     avatars0.githubusercontent.com
151.101.184.133     avatars1.githubusercontent.com
151.101.184.133     avatars2.githubusercontent.com
151.101.184.133     avatars3.githubusercontent.com
151.101.184.133    avatars4.githubusercontent.com
151.101.184.133     avatars5.githubusercontent.com
151.101.184.133     avatars6.githubusercontent.com
151.101.184.133     avatars7.githubusercontent.com
151.101.184.133     avatars8.githubusercontent.com
# GitHub End

问题得到解决。

解决办法二
如果上面失效了 替换成以下内容:

# GitHub Start


199.232.28.133    user-images.githubusercontent.com

151.101.184.133    assets-cdn.github.com

151.101.184.133    raw.githubusercontent.com

151.101.184.133    gist.githubusercontent.com

151.101.184.133    cloud.githubusercontent.com

151.101.184.133    camo.githubusercontent.com

151.101.184.133    avatars0.githubusercontent.com

199.232.68.133     avatars0.githubusercontent.com

199.232.28.133     avatars1.githubusercontent.com

151.101.184.133    avatars1.githubusercontent.com

151.101.184.133    avatars2.githubusercontent.com

199.232.28.133     avatars2.githubusercontent.com

151.101.184.133    avatars3.githubusercontent.com

199.232.68.133     avatars3.githubusercontent.com

151.101.184.133    avatars4.githubusercontent.com

199.232.68.133     avatars4.githubusercontent.com

151.101.184.133    avatars5.githubusercontent.com

199.232.68.133     avatars5.githubusercontent.com

151.101.184.133    avatars6.githubusercontent.com

199.232.68.133     avatars6.githubusercontent.com

151.101.184.133    avatars7.githubusercontent.com

199.232.68.133     avatars7.githubusercontent.com

151.101.184.133    avatars8.githubusercontent.com

199.232.68.133     avatars8.githubusercontent.com

 

# GitHub End

昨天配置完,解决了问题,今天再登,发现又被墙了,遂想知道问题出在哪,先说解决办法:

  1. 浏览器打开 https://www.ip138.com/ 网址输入 上图中 红框地址 raw.githubusercontent.com进行查询:
    在这里插入图片描述

  2. Windows系统:打开路径 C:\Windows\System32\drivers\etc\hosts,替换raw.githubusercontent.com域名前面的ip地址为查询到的任意一个ip,保存后 再次打开 github,应该就有了,亲测有效,如果哪天再出现无法加载,重复以上步骤,替换最新IP地址。

无法加载原因

我看到网上很多人说是DNS投毒所致,勤换IP吧,我别无他法,如果谁有更好的办法可以留言。

修改IPv4里DNS地址为谷歌的8.8.8.8/8.8.4.4那个方法我试了,没效果,可能我改完没删掉
hosts里的第一行和第二行?? 先这样吧 出了问题 以后再尝试

  • 5
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

黑朱雀

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值