修改/etc/hosts,添加以下
#2022-4最新修改,来源51.ruyo.net 140.82.113.26 alive.github.com 140.82.112.26 live.github.com 185.199.108.154 github.githubassets.com 140.82.114.21 central.github.com 185.199.108.133 desktop.githubusercontent.com 185.199.108.153 assets-cdn.github.com 185.199.108.133 camo.githubusercontent.com 185.199.108.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.4 github.com 192.0.66.2 github.blog 140.82.112.6 api.github.com 185.199.108.133 raw.githubusercontent.com 185.199.108.133 user-images.githubusercontent.com 185.199.108.133 favicons.githubusercontent.com 185.199.108.133 avatars5.githubusercontent.com 185.199.108.133 avatars4.githubusercontent.com 185.199.108.133 avatars3.githubusercontent.com 185.199.108.133 avatars2.githubusercontent.com 185.199.108.133 avatars1.githubusercontent.com 185.199.108.133 avatars0.githubusercontent.com 185.199.108.133 avatars.githubusercontent.com 140.82.112.10 codeload.github.com 52.216.184.147 github-cloud.s3.amazonaws.com 54.231.141.9 github-com.s3.amazonaws.com 52.217.99.156 github-production-release-asset-2e65be.s3.amazonaws.com 52.216.109.203 github-production-user-asset-6210df.s3.amazonaws.com 52.217.65.188 github-production-repository-file-5c1aeb.s3.amazonaws.com 185.199.108.153 githubstatus.com 64.71.144.211 github.community 23.100.27.125 github.dev 185.199.108.133 media.githubusercontent.com
以下部分已失效:
# 2020年12月30日更新 # GitHub Start 52.74.223.119 github.com 52.74.223.119 gist.github.com 54.169.195.247 api.github.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
缺点总结
1、修改hosts方式也就是一种临时解决的方案!因为不同的运营商,地区干扰的程度不一样!这个方法还不一定有用!
所以hosts并不是一劳永逸的方式!
2、有时候还会因为在hosts指定了IP导致无法正常访问Github。
该方法不适用与那些被Q的站,比如Google,脸书 等等
3、存在随时可能过期失效的问题。此问题可以通过以下方法解决:
1)打开 https://www.ipaddress.com/ 输入访问不了的域名,比如:github.com , raw.githubusercontent.com
查询之后可以获得正确的 IP 地址
2)手动自己找是比较繁琐的,这里分享一个代码,自动生成Hosts
某大佬分享的仓库:https://github.com/521xueweihan/GitHub520
malaohu博主自建项目地址:https://github.com/malaohu/GitHubHosts
文章评论