访问GitHub加速方法

一,手动配置

手动配置既是更改C:\Windows\System32\drivers\etc 下的 hosts 文件

具体方法如下:

通过ipaddress查询以下ip地址

github.com
gist.github.com
github.global.ssl.fastly.net
assets-cdn.github.com
raw.githubusercontent.com

 

 点击Lookup查看 140.82.114.3 就是github.com的地址。

同理查询其他域名地址记录如下:

140.82.113.4 github.com
140.82.114.3 gist.github.com
199.232.69.194 github.global.ssl.fastly.net
185.199.109.153 assets-cdn.github.com

 最后一个加上这些地址如下:

#下面ip都是assets-cdn.github.com的地址
185.199.111.133 raw.githubusercontent.com
185.199.111.133 cloud.githubusercontent.com
185.199.111.133 camo.githubusercontent.com
185.199.111.133 avatars0.githubusercontent.com
185.199.111.133 avatars1.githubusercontent.com
185.199.111.133 avatars2.githubusercontent.com
185.199.111.133 avatars3.githubusercontent.com
185.199.111.133 avatars4.githubusercontent.com
185.199.111.133 avatars5.githubusercontent.com
185.199.111.133 avatars6.githubusercontent.com
185.199.111.133 avatars7.githubusercontent.com
185.199.111.133 avatars8.githubusercontent.com

 最好hosts文件中加入记录的代码如下:

#github
140.82.113.4 github.com
140.82.114.3 gist.github.com
199.232.69.194 github.global.ssl.fastly.net
185.199.109.153 assets-cdn.github.com
#下面ip都是assets-cdn.github.com的地址
185.199.111.133 raw.githubusercontent.com
185.199.111.133 cloud.githubusercontent.com
185.199.111.133 camo.githubusercontent.com
185.199.111.133 avatars0.githubusercontent.com
185.199.111.133 avatars1.githubusercontent.com
185.199.111.133 avatars2.githubusercontent.com
185.199.111.133 avatars3.githubusercontent.com
185.199.111.133 avatars4.githubusercontent.com
185.199.111.133 avatars5.githubusercontent.com
185.199.111.133 avatars6.githubusercontent.com
185.199.111.133 avatars7.githubusercontent.com
185.199.111.133 avatars8.githubusercontent.com

 注:最好每个地址都ping下,看是否通。

最好命令行ipconfig /flushdns 刷新下dns

二,自动配置

网上提供SwitchHosts工具可以自动帮配置hosts文件

github地址:https://github.com/oldj/SwitchHosts

gitee地址:https://gitee.com/snow2zhou/SwitchHosts

具体方法看说明文档。感谢大神些的贡献分享。

大概长这个样子:

最后都能正常的访问github了。 

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值