日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 综合教程 >内容正文

综合教程

解决国内访问github速度慢的问题

發布時間:2024/5/24 综合教程 38 生活家
生活随笔 收集整理的這篇文章主要介紹了 解决国内访问github速度慢的问题 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

從簡書中轉載:

https://www.jianshu.com/p/66facbd8926a

由于某些原因,國內訪問github會異常緩慢,在clone倉庫時甚至只有10k一下的速度,下載半天也下不完。

本文介紹通過修改系統hosts文件的棒啊,繞過國內dns解析,直接訪問github的cdn節點,從而達到加速的目的。

1.進入github官方cdn地址

https://www.ipaddress.com/

2.查詢下面兩個連接的dns解析地址

github.com

github.global.ssl.fastly.net

3.修改系統hosts文件

打開系統hosts文件(管理員權限)

windows路徑:C:WindowsSystem32driversetc

mac打開方式sudo vim /etc/hosts

在末尾添加三行記錄并保存。注意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

199.232.69.194 github.global.ssl.fastly.net

4.刷新系統dns緩存

windows:

Windows + X 打開系統命令行(管理員身份)或者 powershell

運行 ipconfig /flushdns 手動刷新系統dns緩存

mac:

sudo killall -HUP mDNSResponder

5.大功告成

總結

以上是生活随笔為你收集整理的解决国内访问github速度慢的问题的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。