解决Github图片资源无法访问的问题


修改C:\Windows\System32\drivers\etc下的hosts文件

良心教程!

修改思路:
第一步,查找域名ip地址:
1、 在未显示图片的页面右键审查元素

2、
在这里插入图片描述3、
在这里插入图片描述
4、找到该图片的域名:user-images.githubusercontent.com
5、来这里查询该域名的ip地址
第二步:修改hosts文件:
修改方式举例:
比如我在2020/7/3号查到的域名如下:
在这里插入图片描述
于是在hosts文件末尾添加如下代码:
在这里插入图片描述
注意该代码分为两部分,199.232.68.133user-images.githubusercontent.com
一般而言,199.232.68.133在不同时间段内会发生变化的,因此,这就是为什么你们去复制大部分博文给的现成的代码来修改hosts但是无效的原因,这里,我不给出现成的代码,我会给出代码模板,大家可以根据上述步骤来自行修改hosts文件。

199.232.68.133 raw.githubusercontent.com
199.232.68.133 camo.githubusercontent.com
199.232.68.133 gist.githubusercontent.com
199.232.68.133 cloud.githubusercontent.com
199.232.68.133 assets-cdn.githubusercontent.com
199.232.68.133 user-images.githubusercontent.com
199.232.68.133 avatars0.githubusercontent.com
199.232.68.133 avatars1.githubusercontent.com
199.232.68.133 avatars2.githubusercontent.com
199.232.68.133 avatars3.githubusercontent.com
199.232.68.133 avatars4.githubusercontent.com
199.232.68.133 avatars5.githubusercontent.com
199.232.68.133 avatars6.githubusercontent.com
199.232.68.133 avatars7.githubusercontent.com
199.232.68.133 avatars8.githubusercontent.com

在这里插入图片描述


文章作者: 青衫读书人
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 青衫读书人 !
评论
  目录