GitHub下载提速

通过修改hosts文件来提速(该方法也可加速其他因为CDN被屏蔽导致访问慢的网站)

第一步:获取GitHub的IP地址

通过访问:http://tool.chinaz.com/dns或者https://www.ipaddress.com/ 获取以下三个网站的ip

github.com、github.global.ssl.fastly.net、codeload.github.com

(assets-cdn.github.com 、avatars0.githubusercontent.com )

第二步:选择TTL值较小的填入hosts文件中

hosts文件路径:C:WindowsSystem32driversetc

(注:修改hosts文件需要管理员权限,可以复制到桌面修改过后再覆盖文件)

第三步:刷新DNS

修改完hosts还不会立即生效,需要刷新DNS缓存

linux下输入指令:sudo /etc/init.d/networking restart 即可。

windows下刷新DNS的方法:

打开CMD

输入ipconfig /flushdns

然后关闭浏览器再访问github时下载速度就会明显挺高

参考

https://blog.csdn.net/weixin_37910453/article/details/86655613

原文地址:https://www.cnblogs.com/wj1998/p/10750307.html