By looking at the download link, you can see that it ends up on Amazon’s server (github-cloud.s3.Amazonaws.com). Since it is very slow to access Amazon website in China, we need to modify the Hosts file to achieve smooth access.

After modifying the Hosts file, the network speed easily exceeded 3MiB/s. I feel that GitHub is still saved, and I can use GitHub happily again.

First, open the Hosts file on your local machine

First, what is the Hosts file?

In Internet protocol, host refers to a local computer that can communicate with other machines. A local machine has a unique identifier code that, along with a network mask, constitutes an IP address. If you access the Internet through a point-to-point protocol (P2P) ISP, you will have a unique IP address for the duration of the connection, and for that time your host will be a host.

In this case, host represents a network node. Host works according to the TCP/IP for Windows standard, which contains the mapping between IP address and host name. It is a stipulation for mapping IP address and host name. The stipulation requires that each segment can contain only one mapping. The IP address must be placed at the beginning of each paragraph, followed by the mapping Host name. The mapping description of this paragraph is divided with “#” and then explained with words.

Terminal input:

sudo vim /etc/hosts

Once opened, we need to append information to it.

Second, append the IP address of the domain name

We can use www.ipaddress.com/ to obtain the IP addresses of the following two GitHub domains:

(1) github.com

(2) github.global.ssl.fastly.net

After opening the webpage, use the input fields to query two domain names respectively:

Try github.com first:

Note any OF the marked IP addresses.

Then the github.global.ssl.fastly.net:

Write the preceding two IP addresses to the Hosts file:

Press Esc and enter :wq to save and exit.

Step 3, refresh DNS cache (updated at 2019.08.28)

1. In Windows, enter CMD and run the following command:

ipconfig /flushdns
Copy the code

2. Log in to the TERMINAL in the Mac system and run the following command:

lookupd -flushcache
Copy the code

Newer Apple Mac OS X systems should use the following command:

type  dscacheutil -flushcache
Copy the code

Update DNS on OS X Mountain Lion or Lion should be (provided by Shiny, ref) :

sudo killall -HUP mDNSResponder
Copy the code

Ok, it’s that simple!!