chrome登不上Git,一直出现响应时间过长的问题
1.访问www.github.com - Server Speed, Location, and DNS Records, 查看Git Hub的ip地址
如下图:
2.在hosts文件中增加一行(注意,前面的是上面查到的ip地址,不要照着我的写,要改成查到的)
140.82.113.3 github.com
可以用文本txt打开
windows下hosts文件的路径为: C:\Windows\System32\drivers\etc\
绕过dns解析,在本地直接绑定host,该方法也可加速其他因为CDN被屏蔽导致访问慢的网站。
hosts文件所在目录,C:\Windows\System32\drivers\etc
修改windows里的hosts文件,添加如下内容
192.30.253.112 github.com
192.30.253.119 gist.github.com
151.101.100.133 assets-cdn.github.com
151.101.100.133 raw.githubusercontent.com
151.101.100.133 gist.githubusercontent.com
151.101.100.133 cloud.githubusercontent.com
151.101.100.133 camo.githubusercontent.com
151.101.100.133 avatars0.githubusercontent.com
151.101.100.133 avatars1.githubusercontent.com
151.101.100.133 avatars2.githubusercontent.com
151.101.100.133 avatars3.githubusercontent.com
151.101.100.133 avatars4.githubusercontent.com
151.101.100.133 avatars5.githubusercontent.com
151.101.100.133 avatars6.githubusercontent.com
151.101.100.133 avatars7.githubusercontent.com
151.101.100.133 avatars8.githubusercontent.com
windows下刷新DNS的方法:
打开cmd
输入ipconfig /flushdns
亲测有用,下载速度明显提升
3,如果在保存hosts文件时没有权限,需要按照下面步骤获取修改hosts文件的权限
弹出上面对话框。
说明电脑当前登录用户没有权限给该文件进行编辑操作。这时候可以修改一下该文件的权限属性。右键点击hosts文件,选择属性,点击安全----高级
可以在组或用户名里选择对象进行更改,至此完成