优雅的访问开源代码库–Github

2020-03-23

最近,发觉了学习前人 大佬的思想,能够升华自己🐶(手动狗头)。这不是过年冠状病毒横行,各个国家都在积极抗击疫情。当然,很多国家开始采取临时封锁的措施,随着而来的,国内访问国外大公司有些困难。

img

今天给大家介绍一种提高访问 开源社区–Github 的方法,亲测有效.

话不多说,解决方法奉上:

192.30.255.112 gist.github.com
192.30.255.112 github.com
192.30.255.112 www.github.com
151.101.56.133 avatars0.githubusercontent.com
151.101.56.133 avatars1.githubusercontent.com
151.101.56.133 avatars2.githubusercontent.com
151.101.56.133 avatars3.githubusercontent.com
151.101.56.133 avatars4.githubusercontent.com
151.101.56.133 avatars5.githubusercontent.com
151.101.56.133 avatars6.githubusercontent.com
151.101.56.133 avatars7.githubusercontent.com
151.101.56.133 avatars8.githubusercontent.com
151.101.56.133 camo.githubusercontent.com
151.101.56.133 cloud.githubusercontent.com
151.101.56.133 gist.githubusercontent.com
151.101.56.133 marketplace-screenshots.githubusercontent.com
151.101.56.133 raw.githubusercontent.com
151.101.56.133 repository-images.githubusercontent.com
151.101.56.133 user-images.githubusercontent.com

介绍一下,上面代码行是常用 Github 网站的 hosts 列表。 hosts 就相当于本地 DNS 服务器的功能,记录一些常见 IP 与 域名的对应关系,当浏览器发送请求时,会优先查询本地的 hosts 文件,之后才去请求自己网络的 DNS 服务器。设置本地 hosts 可以有效提高访问网页的速度。当然,如果域名和 IP 地址发生改变,还需要手动修改 hosts 文件,使访问速度更快。

imgwin系统下hosts文件

修改 hosts 文件步骤: win系统 hosts 文件默认位置是:“ C:\windows\system32\drivers\etc\hosts ”,Linux系统 hosts 文件默认位置在:“ /etc/hosts ”。win系统可以手动切换到默认位置目录,使用记事本进行编辑。Linux可以使用 vim 命令修改hosts文件。

修改完 hosts 文件,一定要记得保存哟 o(=•ェ•=)m !!!

注意:本次演示 hosts 文件是具有时效性,因为网站的域名和 IP 并不是绑死的原因,仅供最近时期的使用。

接下来,访问 Github 网站,就会发现如巧克力一样丝滑喽….

img

希望,你能够得到你所向往的美好事物。向前进,不畏困难 !!!