0%

通过更改Hosts解决Github进不去

说明

最近在家上GitHub还算比较多,但是发现经常进不去,最近的梯子也进本都挂了,导致GitHub有时候进不去,然后去网上搜了很多办法,发现效果还比较好,在这里做一个小小的总结和分享。

原因分析

今天实在看到大佬稚晖君开源的项目很激动,转手去GitHub却发现打不开,然后直接F12走起看了下network,发现和网上说的一样,很多域名都是指向:github.global.ssl.fastly.net,因为我们的互联网高墙的原因当然是无法请求成功的,于是想到了改Hosts文件,不同的系统Hosts文件地址如下:

1
2
3
4
5
6
Windows系统hosts位于    C:\Windows\System32\drivers\etc\hosts   
Android系统hosts位于 /etc/hosts
Mac系统hosts位于 /etc/hosts
IOS系统hosts位于 /etc/hosts
Linux系统hosts位于 /etc/hosts
绝大多数Unix系统都是在 /etc/hosts

具体操作

用管理员权限打开Hosts文件,添加如下整合多人的内容:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
74.125.237.1 dl-ssl.google.com
74.125.128.95 ajax.googleapis.com
185.31.16.185 github.global.ssl.fastly.net
192.30.253.112 github.com
192.30.252.131 github.com
192.30.253.119 gist.github.com
151.101.100.133 assets-cdn.github.com
151.101.100.133 raw.githubusercontent.com
151.101.100.133 gist.githubusercontent.com
151.101.100.133 cloud.githubusercontent.com
151.101.100.133 camo.githubusercontent.com
151.101.100.133 avatars0.githubusercontent.com
151.101.100.133 avatars1.githubusercontent.com
151.101.100.133 avatars2.githubusercontent.com
151.101.100.133 avatars3.githubusercontent.com
151.101.100.133 avatars4.githubusercontent.com
151.101.100.133 avatars5.githubusercontent.com
151.101.100.133 avatars6.githubusercontent.com
151.101.100.133 avatars7.githubusercontent.com
151.101.100.133 avatars8.githubusercontent.com
173.194.127.200 groups.google.com

最后保存,重启浏览器即可。

说明

这个我基本上是参考网上的教程,非常感谢他们的分享,我在这里知识做一个小小的整合。具体参考的如下:lusic01的CSDN博客和百度经验

-------------本文结束感谢您的阅读-------------