[toc]

preface

GitHub believes that everyone is familiar with the open source world, the absolute trump card, to say that it is the cornerstone of small and medium-sized Internet companies.

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 distribution acceleration network is contaminated by DNS. Slowness, of course, is intolerable to every siege lion.

DNS contamination:

DNS cache pollution, also known as DNS cache poisoning, is a case of deliberately or inadvertently produced domain name server data packets that refer domain names to incorrect IP addresses. Generally, there are reliable domain servers on the Internet. However, to reduce the traffic pressure on the network, domain name servers usually store the resolution records obtained from the upstream domain name servers temporarily. When another machine requests domain name resolution, they can immediately provide service. Once the cache of the local domain name server for the domain is contaminated, computers in the domain are directed to the wrong server or to the server's WEB address.

The following describes how to change Host, which is equivalent to bypassing domestic DNS resolution and directly accessing GitHub’S CDN node, thus achieving the purpose of acceleration.


steps

The first step

Open IPAddress.com and query the IP addresses of the following three urls

github.com

assets-cdn.github.com

github.global.ssl.fastly.net
Copy the code

The second step

Example Modify the hosts file on the local PC

  • 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
Copy the code

The third step

Refreshing the System DNS Cache (Windows)

Linux skips this step

Use the WIN+R shortcut key to open the running window. Enter CMD and press Enter to enter the command line window. Then run the ipconfig /flushdns command and press Enter to refresh the local DNS cache data.

Git Clone is now complete


Set pieces

Some are not satisfied with the current speed is geek friends, please visit http://ping.chinaz.com/github.com, fastest query node IP for a visit.