解决GitHub图片不显示问题

最近发现 GitHub 的图片打不开了,如下

解决GitHub图片不显示问题_第1张图片
原因是域名污染,这个就不解释了,反正照着下面的解决方法搞定就行。

解决方法:
打开 C:\Windows\System32\drivers\etc 下的 hosts 文件

解决GitHub图片不显示问题_第2张图片
在最后加入如下内容保存就可以了。

# GitHub
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

或者加入下列亦可:

# GitHub520 Host Start
185.199.108.154               github.githubassets.com
199.232.96.133                camo.githubusercontent.com
199.232.96.133                github.map.fastly.net
199.232.69.194                github.global.ssl.fastly.net
140.82.114.3                  gist.github.com
185.199.108.153               github.io
140.82.114.3                  github.com
140.82.113.6                  api.github.com
199.232.96.133                raw.githubusercontent.com
199.232.96.133                user-images.githubusercontent.com
199.232.96.133                favicons.githubusercontent.com
199.232.96.133                avatars5.githubusercontent.com
199.232.96.133                avatars4.githubusercontent.com
20.185.234.66                 avatars3.githubusercontent.com
199.232.96.133                avatars2.githubusercontent.com
199.232.96.133                avatars1.githubusercontent.com
199.232.96.133                avatars0.githubusercontent.com
140.82.114.10                 codeload.github.com
52.216.128.147                github-cloud.s3.amazonaws.com
52.217.39.108                 github-com.s3.amazonaws.com
52.216.107.188                github-production-release-asset-2e65be.s3.amazonaws.com
52.217.17.148                 github-production-user-asset-6210df.s3.amazonaws.com
52.217.96.108                 github-production-repository-file-5c1aeb.s3.amazonaws.com
# Star me GitHub url: https://github.com/521xueweihan/GitHub520
# GitHub520 Host End

注:如果无法保存,可以用 vscode 打开,以管理员身份保存覆盖;或者复制一份,修改保存后再替换即可。

如果以后又无法打开了,解决方法还是修改此文件更新ip,最终效果如下

解决GitHub图片不显示问题_第3张图片
更新 IP 方法可参考下面这篇文章:更新IP

附录:
提高github网页加载的几种方法

你可能感兴趣的:(git,github)