话不多说,上干货~~~

1. 打开 http://tool.chinaz.com/dns/ ,在输入框中填写 github.com,然后点击检测按钮,会列出响应ip,如图:
解决GitHub访问慢_缓存

 

 2. 找到hosts文件,win10 hosts位置:C:\Windows\System32\drivers\etc,

3.以管理员身份运行hosts文件,如下图:

解决GitHub访问慢_输入框_02

 

 解决GitHub访问慢_输入框_03

 

 解决GitHub访问慢_JAVA_04

 

 

  在hosts文件结尾输入:

  # github

  66.249.89.104 github.com

  52.69.186.44 github.com
保存为hosts.txt

4.打开cmd窗口

  执行 ipconfig /flushdns

  刷新DNS缓存

完成,再访问github.com就很快了。以后再访问慢,照此方法再来一遍就OK了