公告:魔扣目录网为广大站长提供免费收录网站服务,提交前请做好本站友链:【 网站目录:https://www.morko.net 】, 免友链快审服务(50元/站),

点击这里在线咨询客服
新站提交
  • 网站:51998
  • 待审:31
  • 小程序:12
  • 文章:1030137
  • 会员:747

由于某些原因,国内访问Github会异常缓慢,在clone仓库时甚至只有10k以下的速度,下载半天有时还会失败需要从头再来,甚是让人恼火。

本文介绍通过修改系统hosts文件的办法,绕过国内DNS解析,直接访问GitHub的CDN节点,从而达到加速的目的。不需要科学上网,也不需要海外的服务器辅助。

1 获取GitHub官方CDN地址

打开https://www.ipaddress.com/

查询以下三个链接的DNS解析地址

  1. github.com
  2. assets-cdn.github.com
  3. github.global.ssl.fastly.net
加速国内Github访问

 

记录下查询到的IP地址。

加速国内Github访问

 

2 修改系统Hosts文件

打开系统hosts文件(需管理员权限)。

路径:C:windowsSystem32driversetc

在末尾添加三行记录并保存。(需管理员权限,注意IP地址与域名间需留有空格)

# 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 github.com

151.101.72.133 assets-cdn.github.com

151.101.193.194 github.global.ssl.fastly.net

3 刷新系统DNS缓存

Windows+X 打开系统命令行(管理员身份)或powershell

运行 ipconfig /flushdns 手动刷新系统DNS缓存。

加速国内Github访问

 

现在打开Github,clone一个项目到本地试试吧,作者这电信的宽带会轻松达到10M/s的速度。

分享到:
标签:Github
用户无头像

网友整理

注册时间:

网站:5 个   小程序:0 个  文章:12 篇

  • 51998

    网站

  • 12

    小程序

  • 1030137

    文章

  • 747

    会员

赶快注册账号,推广您的网站吧!
最新入驻小程序

数独大挑战2018-06-03

数独一种数学游戏,玩家需要根据9

答题星2018-06-03

您可以通过答题星轻松地创建试卷

全阶人生考试2018-06-03

各种考试题,题库,初中,高中,大学四六

运动步数有氧达人2018-06-03

记录运动步数,积累氧气值。还可偷

每日养生app2018-06-03

每日养生,天天健康

体育训练成绩评定2018-06-03

通用课目体育训练成绩评定