GitHub图片加载异常以及README.md添加图片异常

这些问题是由于 github 的一些域名的 DNS 解析被污染,导致 DNS 解析过程无法通过域名取得正确的 IP 地址。解决方案如下:
https://www.bilibili.com/video/BV1CD4y197tj?from=search&seid=1671507888412118222
笔者是参考了视频中的解决方案。
再总结一下就是:将如下代码拷贝添加到host文件中
windows host 路径:C:\Windows\System32\drivers\etc\host
需要拷贝的代码链接:https://github.com/itgoyo/500Days-Of-Github/issues/231
140.82.114.4 github.com
140.82.114.4 gist.github.com
185.199.108.153 assets-cdn.github.com
151.101.64.133 raw.githubusercontent.com
151.101.108.133 gist.githubusercontent.com
151.101.108.133 cloud.githubusercontent.com
151.101.108.133 camo.githubusercontent.com
151.101.108.133 avatars0.githubusercontent.com
151.101.108.133 avatars1.githubusercontent.com
151.101.108.133 avatars2.githubusercontent.com
151.101.108.133 avatars3.githubusercontent.com
151.101.108.133 avatars4.githubusercontent.com
151.101.108.133 avatars5.githubusercontent.com
151.101.108.133 avatars6.githubusercontent.com
151.101.108.133 avatars7.githubusercontent.com
151.101.108.133 avatars8.githubusercontent.com
如果你不想通过这样的方式更改host文件,还可以通过一款软件来管理host文件
SwitchHosts下载地址:https://github.com/oldj/SwitchHosts/releases
安装后将代码拷贝到My hosts 区域,打开开关:
GitHub图片加载异常以及README.md添加图片异常
此时GitHub就可以正常显示图片了,在README.md文件中添加图片
GitHub图片加载异常以及README.md添加图片异常
https://github.com/用户名/项目名/raw/分支/图片文件夹/文件名
图片需要上传到GitHub,正常显示如下:
GitHub图片加载异常以及README.md添加图片异常