解决Github图片加载不出来的问题
笔记本电脑打开Github有时候图片加载不出来,而台式机则没有这个问题。Chrome浏览器F12进入Network标签,然后Disable cache之后刷新页面,发现是几个avatars5.githubusercontent.com
之类的网页资源加载失败了。
最简单的解决办法是打开IPAddress.com找到对应的ip地址,然后加入hosts文件。但是由于不止一个网址失败,这里我想要找到一个更自动化的解决办法。
参考Github520项目,解决办法有以下几种:
- 手动修改hosts文件
- SwitchHosts自动管理
- AdGuard Home自动管理DNS
手动修改hosts文件
# GitHub520 Host Start
185.199.108.154 github.githubassets.com
199.232.68.133 camo.githubusercontent.com
199.232.68.133 github.map.fastly.net
199.232.69.194 github.global.ssl.fastly.net
140.82.112.4 gist.github.com
185.199.108.153 github.io
140.82.113.4 github.com
140.82.112.5 api.github.com
199.232.68.133 raw.githubusercontent.com
199.232.68.133 user-images.githubusercontent.com
199.232.68.133 favicons.githubusercontent.com
199.232.68.133 avatars5.githubusercontent.com
199.232.68.133 avatars4.githubusercontent.com
199.232.68.133 avatars3.githubusercontent.com
199.232.68.133 avatars2.githubusercontent.com
199.232.68.133 avatars1.githubusercontent.com
199.232.68.133 avatars0.githubusercontent.com
140.82.113.9 codeload.github.com
52.216.128.147 github-cloud.s3.amazonaws.com
52.216.228.96 github-com.s3.amazonaws.com
52.217.93.220 github-production-release-asset-2e65be.s3.amazonaws.com
52.216.12.100 github-production-user-asset-6210df.s3.amazonaws.com
52.216.20.155 github-production-repository-file-5c1aeb.s3.amazonaws.com
# Star me GitHub url: https://github.com/521xueweihan/GitHub520
# GitHub520 Host End
SwitchHosts配置文件
Title: Github
Type: Remote
URL: https://gitee.com/xueweihan/codes/6g793pm2k1hacwfbyesl464/raw?blob_name=GitHub520.yml
Auto Refresh: 1 hour
AdGuard Home自定义DNS封锁列表
URL: https://gitee.com/xueweihan/codes/6g793pm2k1hacwfbyesl464/raw?blob_name=GitHub520.yml