解决github速度慢的问题

GitHub访问及git工具克隆慢问题解决

一、查询合适的DNS服务器

1、站长工具DNS查询服务器
github.com
github.global.ssl.fastly.net
2、选择TTL值最小的记录,记录下对应服务器IP地址
例如
github.com  192.30.255.112
github.global.ssl.fastly.net  151.101.189.194
二、更改hosts文件的DNS配置

windows的hosts位置:
C:\Windows\System32\drivers\etc\hosts
在文件最后添加两条信息
192.30.255.112 github.com
151.101.189.194 github.global.ssl.fastly.net

我的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

# 192.30.253.112  www.github.com

140.82.113.4 	www.github.com
140.82.114.4 	www.github.com

192.30.253.113  github.com
192.30.253.112  github.com
140.82.113.3    github.com

# 151.101.76.133 avatars0.githubusercontent.com
# 192.30.255.113 www.github.com
# 13.229.188.59  www.github.com
# 52.74.223.119  www.github.com
# 13.250.177.223 www.github.com


151.101.109.194 github.global.ssl.fastly.net
# 151.101.77.194  github.global.ssl.fastly.net
# 151.101.189.194 github.global.ssl.fastly.net


185.199.110.153  www.codeload.github.com 
# 185.199.109.153  www.codeload.github.com 
# 185.199.111.153  www.codeload.github.com  
# 185.199.108.153  www.codeload.github.com  
# 192.30.253.120   www.codeload.github.com


185.199.111.153 assets-cdn.github.com
# 185.199.108.153 assets-cdn.github.com
# 185.199.110.153 assets-cdn.github.com
# 185.199.109.153 assets-cdn.github.com
# 185.199.111.153 assets-cdn.github.com





三、清除DNS缓存

输入命令行:
Windows:
输入ipconfig /flushdns
Linux:
sudo /etc/init.d/networking restart 

 

 

你可能感兴趣的:(解决github速度慢的问题)