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

2022-07-30 11:37:39

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

解决办法一

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

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

# GitHub Start192.30.253.112    Build software better, together192.30.253.119     gist.github.com151.101.184.133     assets-cdn.github.com151.101.184.133     raw.githubusercontent.com151.101.184.133     gist.githubusercontent.com151.101.184.133     cloud.githubusercontent.com151.101.184.133     camo.githubusercontent.com151.101.184.133     avatars0.githubusercontent.com151.101.184.133     avatars1.githubusercontent.com151.101.184.133     avatars2.githubusercontent.com151.101.184.133     avatars3.githubusercontent.com151.101.184.133    avatars4.githubusercontent.com151.101.184.133     avatars5.githubusercontent.com151.101.184.133     avatars6.githubusercontent.com151.101.184.133     avatars7.githubusercontent.com151.101.184.133     avatars8.githubusercontent.com# GitHub End

问题得到解决。

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

# GitHub Start199.232.28.133    user-images.githubusercontent.com151.101.184.133    assets-cdn.github.com151.101.184.133    raw.githubusercontent.com151.101.184.133    gist.githubusercontent.com151.101.184.133    cloud.githubusercontent.com151.101.184.133    camo.githubusercontent.com151.101.184.133    avatars0.githubusercontent.com199.232.68.133     avatars0.githubusercontent.com199.232.28.133     avatars1.githubusercontent.com151.101.184.133    avatars1.githubusercontent.com151.101.184.133    avatars2.githubusercontent.com199.232.28.133     avatars2.githubusercontent.com151.101.184.133    avatars3.githubusercontent.com199.232.68.133     avatars3.githubusercontent.com151.101.184.133    avatars4.githubusercontent.com199.232.68.133     avatars4.githubusercontent.com151.101.184.133    avatars5.githubusercontent.com199.232.68.133     avatars5.githubusercontent.com151.101.184.133    avatars6.githubusercontent.com199.232.68.133     avatars6.githubusercontent.com151.101.184.133    avatars7.githubusercontent.com199.232.68.133     avatars7.githubusercontent.com151.101.184.133    avatars8.githubusercontent.com199.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里的第一行和第二行?? 先这样吧 出了问题 以后再尝试

  • 作者:黑朱雀
  • 原文链接:https://blog.csdn.net/weixin_43639682/article/details/113252004
    更新时间:2022-07-30 11:37:39