Home  >  Article  >  Development Tools  >  Quietly share how to speed up access to Github! (recommend)

Quietly share how to speed up access to Github! (recommend)

藏色散人
藏色散人forward
2021-12-20 11:28:103328browse

Preface

I believe everyone is familiar with GitHub. It is the absolute trump card in the open source world. It is not an exaggeration to say that it is the cornerstone of small and medium-sized Internet companies.

However, due to some reasons in China, git-related operations are very slow. There are many reasons for the slow access speed of GitHub in China, but the most direct and main reason is that the domain name of GitHub's distribution acceleration network has been compromised. To dns pollution. Of course, slowness is something that every siege lion cannot tolerate. [Recommended: Git Tutorial]

Popular science about DNS pollution:

Domain server cache pollution (DNS cache pollution), also known as domain name server cache poisoning (DNS cache poisoning) refers to some intentionally or unintentionally created domain name server packets that point domain names to incorrect IP addresses. Generally speaking, there are trustworthy domain servers on the Internet. However, in order to reduce the traffic pressure on the network, general domain name servers will temporarily store the resolution records obtained from the upstream domain name servers until other machines are available next time. When domain name resolution is required, the service can be provided immediately. Once the cache of the local domain name server of the relevant domain is contaminated, computers in the domain will be directed to the wrong server or the server's URL.

The following describes how to modify the Host, which is equivalent to bypassing domestic DNS resolution and directly accessing GitHub's CDN node to achieve acceleration.

Steps

First step

Open the IPAddress.com website and query the IP addresses corresponding to the following three URLs

github.com
assets-cdn.github.com
github.global.ssl.fastly.net

Quietly share how to speed up access to Github! (recommend)

The second step

Modify the local computer system hosts file

windows: C:\Windows\System32\drivers\etc
linux: /etc/hosts

Add the following code directly at the end:

192.30.253.112 github.com
151.101.184.133 assets-cdn.github.com
151.101.185.194 github.global.ssl.fastly.net

The third step

Refresh the system dns cache (Windows)

Linux skip this step

Use WIN R shortcut Press the key to open the run window, enter the command: cmd and press Enter to enter the command line window. Then enter the command: ipconfig /flushdns and press Enter to refresh the local dns cache data.

Quietly share how to speed up access to Github! (recommend)

So far, the acceleration has been completed, and the siege lions are enjoying git clone

Extra chapter

Some friends are not satisfied with the current speed. Please visit http://ping.chinaz.com/github.com to check the fastest node IP for access.

The above is the detailed content of Quietly share how to speed up access to Github! (recommend). For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:juejin.im. If there is any infringement, please contact admin@php.cn delete