经常在github clone的小伙伴应该会发现clone的时候速度惊奇的慢
1、首先打开www.ipaddress.com站点,在输入框中输入:github.global.ssl.fastly.net并回车
2、回车后会给出映射ip地址(此时请记录下该ip)如下图:
3、重复1-2步骤,获取github.com映射ip并记录
4、修改host文件
Windows下在C:/Windows/system32/drivers/etc/hosts
Ubuntu等linux系一般在/etc/hosts
打开host文件后添加如下内容(ip为刚才记录的ip):
151.101.185.194 github.global.ssl.fastly.net
192.30.253.113 github.com
改完之后需要刷新dns
Windows(cmd):ipconfig /flushdns
Ubuntu:sudo systemctl restart nscd