解决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 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值