使用Host为Github加速
本文最后更新于 1500 天前,其中的信息可能已经有所发展或是发生改变。

内容纲要

背景

由于众所周知的原因,Github从国内访问速度特别的慢。
而我们需要从Github上面Clone代码的时候,这个网速就特别令人心烦。
为了解决这个问题,可以通过众所周知的方法,或者使用更改Host加速访问Github。

事实上Github的DNS配置了多个A记录,通过RoundRobin随机选择一个IP连接。
而我们通过使用Host指定IP,可以强制使用网速最快的那一批连接Github。

正文

将以下记录加入hosts文件中。

192.30.253.118 gist.github.com
185.199.109.153 assets-cdn.github.com
199.232.68.133 raw.githubusercontent.com
199.232.68.133  gist.githubusercontent.com
199.232.68.133 cloud.githubusercontent.com
199.232.68.133 camo.githubusercontent.com
199.232.28.133 avatars0.githubusercontent.com
199.232.28.133 avatars1.githubusercontent.com
199.232.28.133 avatars2.githubusercontent.com
199.232.28.133 avatars3.githubusercontent.com
199.232.28.133 avatars4.githubusercontent.com
199.232.28.133 avatars5.githubusercontent.com
199.232.28.133 avatars6.githubusercontent.com
199.232.28.133 avatars7.githubusercontent.com
199.232.28.133 avatars8.githubusercontent.com

Windows

Windows可更改C:\Windows\System32\Drivers\etc\hosts
更改后使用ipconfig /flushdns清除DNS缓存

macOS

macOS可更改/etc/hosts


Linux

Linux可更改/etc/hosts

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇