Github访问慢解决办法
原因
为什么慢?github的CDN被某墙屏了。
解决方法
绕过dns解析,在本地直接绑定host,该方法也可加速其他因为CDN被屏蔽导致访问慢的网站。
实现
在本地host文件中添加映射,步骤如下:
- 用文本编辑器打开hosts文件,位于C:\Windows\System32\drivers\etc目录下
- 打开 http://tool.chinaz.com/dns ,这是一个查询域名映射关系的工具
- 查询 github.global.ssl.fastly.net 和 assets-cdn.github.com 两个地址
- 多查几次,选择一个稳定,延迟较低的 ip 按如下方式添加到host文件
- 保存文件,重新打开浏览器,起飞。
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
151.101.25.194 github.global.ssl.fastly.net
151.101.128.133 assets-cdn.github.com
219.76.4.4 github-cloud.s3.amazonaws.com