git clone速度太慢解決方案

適用各類操做系統,本次測試於ubuntu,下載速度從二十幾k提升到二百多klinux

一、查找域名對應的ip地址,並修改hosts文件git

nslookup github.global.ssl.fastly.Net
nslookup github.com

這裏寫圖片描述

將下列內容加入 /etc/hosts文件中github

151.101.76.249 http://global-ssl.fastly.net
192.30.255.113 http://github.com  #此處112仍是113根據本身的狀況調整?

二、刷新DNS緩存
linux:web

sudo /etc/init.d/networking restart

windows:ubuntu

ipconfig /flushdns

參考:
http://www.linuxidc.com/Linux/2017-10/148116.htmwindows

http://blog.csdn.net/blgmh/article/details/74531982緩存