关于GitHub网页中头像无法显示的问题

解决GitHub打开头像不显示问题

以前解决完,换个电脑又出现这个问题。
百度了一堆,各种修改hosts文件,结果还是没有解决,真的很烦
在这里插入图片描述

解决(更新于:2021/01/21)

Windows10系统hosts路径:

C:\Windows\System32\drivers\etc

添加:

199.232.96.133 avatars.githubusercontent.com

关于头像不显示解决就是这行。如果失效了,请按我后面的方法去重新获取IP。
在这里插入图片描述

附录

附上我的hosts文件中GitHub的配置(更新于:2021/01/21)

# GitHub Start
52.74.223.119 github.com

52.74.223.119 gist.github.com
54.169.195.247 api.github.com

199.232.96.133 avatars.githubusercontent.com
185.199.111.153 assets-cdn.github.com
199.232.96.133 raw.githubusercontent.com
199.232.96.133 gist.githubusercontent.com
199.232.96.133 cloud.githubusercontent.com
199.232.96.133 camo.githubusercontent.com
199.232.96.133 avatars0.githubusercontent.com
199.232.96.133 avatars1.githubusercontent.com
199.232.96.133 avatars2.githubusercontent.com
199.232.96.133 avatars3.githubusercontent.com
199.232.96.133 avatars4.githubusercontent.com
199.232.96.133 avatars5.githubusercontent.com
199.232.96.133 avatars6.githubusercontent.com
199.232.96.133 avatars7.githubusercontent.com
199.232.96.133 avatars8.githubusercontent.com
199.232.96.133 user-images.githubusercontent.com
185.199.109.154 github.githubassets.com
# GitHub End

方法

下面教大家怎么获取最新IP

注:由于这种域名不是经常变,我感觉第1、2步没必要做,直接复制就可以了
avatars.githubusercontent.com

  1. 鼠标在头像上,右键 --> 检查
    在这里插入图片描述

  2. 复制这里的网址,只需要avatars.githubusercontent.com这部分就可以了
    在这里插入图片描述

  3. 打开IPAddress.com

https://www.ipaddress.com/

在这里插入图片描述

  1. 把刚才复制的网址粘贴进去,回车

  2. 直接往下拖,就可以看到我们想要的ip
    在这里插入图片描述

  3. 格式:

IP + 空格 + 域名
199.232.96.133 avatars.githubusercontent.com

注:由于IP会经常性变化,所以旧的IP有可能失效,就需要重新获取最新的IP地址。

推荐

  1. 给大家推荐一个好用的工具
    SwitchHosts

https://github.com/oldj/SwitchHosts

GitHub开源项目,可以方便的修改hosts文件,自由切换不同环境下的hosts配置。
在这里插入图片描述

  1. GoogleHosts
    这里会更新较全的hosts文件配置,原谅我没有体会到这个项目的妙用 /捂脸

https://github.com/googlehosts/hosts

先就这样吧,以后有需要的再补充更新。

  • 5
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值