If you use a VPS to build your own website, you probably sometimes install open-source programs from GitHub. However, domestic servers like Alibaba Cloud and Tencent Cloud have very slow download speeds from GitHub. We can partially solve this problem indirectly using the following method.
Reasons for slow access:Access to GitHub is inherently slow in some parts of China, simply due to 'geographical incompatibility' (network interference).
Solution approach:GitHub has many servers globally. We just need to find the IP of a GitHub server that your server can access quickly and then manually specify the DNS resolution record in the hosts file.
Specific Method:Use some IP query tools to find the resolved IPs for GitHub in other regions or countries, then edit the server's hosts file. The DNS records to query are:
- github.com
- github.global.ssl.fastly.net
Then, modify the hosts file on the Linux server.
vim /etc/hosts
Press 'i' to insert the following content.
140.82.118.4 github.com
151.101.1.194 github.global.ssl.fastly.net
Then press the ESC key, enter :wq to save. Test it, and you'll notice a significant difference in speed compared to before.
Comments are closed
The comment function for this article is closed. If you have any questions, please feel free to contact us through other channels.