修改hosts文件,加速github访问

修改hosts文件,加速github访问

ZKEASOFT December 06, 2020


Github在中国访问很慢,有时候还打不开,可以通过修改hosts文件来加速,能得到一定的改善。

hosts文件

通过修改hosts文件,可以将指定的域名解析到特定的IP地址。所以我们可以将域名解析到速度较快的服务器,从而提升访问速度。

hosts文件路径是:C:\Windows\System32\drivers\etc\hosts,用记事本打开即可。注意先使用管理员身份打开记事本,再打开该文件。

然后加入以下内容,保存即可:

140.82.114.4 github.com
140.82.112.10 codeload.github.com
185.199.108.153 assets-cdn.github.com
140.82.112.5 api.github.com
140.82.114.25 live.github.com
151.101.76.133 raw.githubusercontent.com
199.232.96.133 avatars.githubusercontent.com
199.232.96.133 camo.githubusercontent.com
199.232.68.133 avatars0.githubusercontent.com
199.232.68.133 avatars1.githubusercontent.com
199.232.68.133 avatars2.githubusercontent.com
199.232.68.133 avatars3.githubusercontent.com
199.232.68.133 avatars4.githubusercontent.com
199.232.68.133 avatars5.githubusercontent.com
199.232.68.133 avatars6.githubusercontent.com
199.232.68.133 avatars7.githubusercontent.com
199.232.68.133 avatars8.githubusercontent.com
199.232.68.133 avatars9.githubusercontent.com

微信公众号