
If you build websites using a VPS, you might sometimes install open-source programs from GitHub. However, domestic servers like Alibaba Cloud and Tencent Cloud often have very slow download speeds from GitHub. We can partially address this issue with the following methods.
Reasons for slow access:
In some regions of China, accessing Github is inherently slow due to network restrictions (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 resolution record in the hosts file.
Specific Method:
Use some IP lookup tools to query the resolved IP of 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 and type :wq to save.
Test it, and the speed will be noticeably different from before.