设置 Host 解决 GitHub 头像不显示

  GitHub 头像和 icon 大部分时间不能正常显示,很影响使用感受,可以通过设置 hosts 文件来解决。

  编辑 hosts 文件:

1
vim /etc/hosts

  在原有配置后追加即可:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# GitHub Avatar Start 
192.30.253.112 Build software better, together
192.30.253.119 gist.github.com
151.101.184.133 assets-cdn.github.com
151.101.184.133 raw.githubusercontent.com
151.101.184.133 gist.githubusercontent.com
151.101.184.133 cloud.githubusercontent.com
151.101.184.133 camo.githubusercontent.com
151.101.184.133 avatars0.githubusercontent.com
151.101.184.133 avatars1.githubusercontent.com
151.101.184.133 avatars2.githubusercontent.com
151.101.184.133 avatars3.githubusercontent.com
151.101.184.133 avatars4.githubusercontent.com
151.101.184.133 avatars5.githubusercontent.com
151.101.184.133 avatars6.githubusercontent.com
151.101.184.133 avatars7.githubusercontent.com
151.101.184.133 avatars8.githubusercontent.com
# GitHub Avatar End

以下为老版,效果自测

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# github avatar
199.232.28.133 assets-cdn.github.com
199.232.28.133 raw.githubusercontent.com
199.232.28.133 gist.githubusercontent.com
199.232.28.133 cloud.githubusercontent.com
199.232.28.133 camo.githubusercontent.com
199.232.28.133 avatars0.githubusercontent.com
199.232.28.133 avatars1.githubusercontent.com
199.232.28.133 avatars2.githubusercontent.com
199.232.28.133 avatars3.githubusercontent.com
199.232.28.133 avatars4.githubusercontent.com
199.232.28.133 avatars5.githubusercontent.com
199.232.28.133 avatars6.githubusercontent.com
199.232.28.133 avatars7.githubusercontent.com
199.232.28.133 avatars8.githubusercontent.com
以上

随笔标题:设置 Host 解决 GitHub 头像不显示

随笔作者:刘先玉

发布时间:2020年04月15日 - 14:26:02

最后更新:2020年04月15日 - 14:26:02

原文链接:https://liuxianyu.cn/article/github-avatar-host.html