配置github.com的host访问

有些时候,我们访问raw.githubusercontent.com的时候,无法访问,可以通过配置host来进行访问。 通过修改host,我们就可以加速访问github,访问变快了,同时下载clone也变快了。

# GitHub Start
52.74.223.119     github.com
52.74.223.119   gist.github.com
54.169.195.247   api.github.com
185.199.111.153   assets-cdn.github.com
199.232.96.133    raw.githubusercontent.com
199.232.96.133    gist.githubusercontent.com
199.232.96.133    cloud.githubusercontent.com
199.232.96.133   camo.githubusercontent.com
199.232.96.133   avatars0.githubusercontent.com
199.232.96.133    avatars1.githubusercontent.com
199.232.96.133   avatars2.githubusercontent.com
199.232.96.133    avatars3.githubusercontent.com
199.232.96.133    avatars4.githubusercontent.com
199.232.96.133    avatars5.githubusercontent.com
199.232.96.133    avatars6.githubusercontent.com
199.232.96.133    avatars7.githubusercontent.com
199.232.96.133    avatars8.githubusercontent.com
199.232.96.133  user-images.githubusercontent.com
185.199.109.154   github.githubassets.com
# GitHub End

bat脚本

@echo on
echo "请注意你的杀毒软件提示,一定要允许"
@echo  ########################################
@xcopy C:\Windows\system32\drivers\etc\hosts C:\Windows\system32\drivers\etc\hosts.bak\ /d /c /i /y
@echo  ########################################
@echo  hosts文件备份完毕,开始修改hosts文件

@echo.>>C:\Windows\System32\drivers\etc\hosts
@echo 140.82.112.4 github.com>>C:\Windows\System32\drivers\etc\hosts
@echo 140.82.113.3 gist.github.com>>C:\Windows\System32\drivers\etc\hosts
@echo 199.232.69.194 github.global.ssl.fastly.net>>C:\Windows\System32\drivers\etc\hosts
@echo 185.199.111.153 assets-cdn.github.com>>C:\Windows\System32\drivers\etc\hosts
@echo 199.232.68.133 raw.githubusercontent.com>>C:\Windows\System32\drivers\etc\hosts

echo   "hosts文件修改完成"
@ipconfig /flushdns
@echo   "刷新DNS完成"
pause