今天突然发现Github用户头像显示不出来了,且上传头像也一直在转圈圈。
在CSDN上搜索了一下,发现大概是DNS域名污染的问题。具体原因如下:github图片不显示的原理
根据网上的解决方法,我进行了以下尝试:
尝试1:修改host文件
打开文件: 【C:\Windows\System32\drivers\etc\hosts】
在文件末尾添加:
# GitHub Start
140.82.113.3 github.com
140.82.114.20 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
199.232.68.133 avatars0.githubusercontent.com
199.232.28.133 avatars1.githubusercontent.com
151.101.184.133 avatars1.githubusercontent.com
151.101.184.133 avatars2.githubusercontent.com
199.232.28.133 avatars2.githubusercontent.com
151.101.184.133 avatars3.githubusercontent.com
199.232.68.133 avatars3.githubusercontent.com
151.101.184.133 avatars4.githubusercontent.com
199.232.68.133 avatars4.githubusercontent.com
151.101.184.133 avatars5.githubusercontent.com
199.232.68.133 avatars5.githubusercontent.com
151.101.184.133 avatars6.githubusercontent.com
199.232.68.133 avatars6.githubusercontent.com
151.101.184.133 avatars7.githubusercontent.com
199.232.68.133 avatars7.githubusercontent.com
151.101.184.133 avatars8.githubusercontent.com
199.232.68.133 avatars8.githubusercontent.com
# GitHub End
然而,刷新网页之后失败了。
- 注意:修改hosts文件时可能出现“没有获得管理员权限”的提示语,此时可以修改用户对hosts文件的权限来实现修改。即“属性 – 安全 – 编辑 – Users 勾选‘修改’权限,并按确定”,此时则可修改hosts文件。
尝试2:刷新本地DNS缓存
在控制台窗口中,使用ipconfig/flushdns
对本地DNS缓存进行刷新。
1.windows开始→运行→输入:CMD 按回车键,打开命令提示符窗口。
2.输入: ipconfig /flushdns
回车,执行命令,重建本地DNS缓存。
然而,最终刷新github之后仍然失败。
尝试3:修改hosts文件
在上述hosts文件修改失败后,我用以下语句代替上面的语句:
199.232.96.133 avatars.githubusercontent.com
最终,刷新页面,成功解决头像不显示的问题!!
Thanks for ur reading!!
如果有帮助的话,不妨一键三连哦~