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 IP lookup tools to query the resolved IPs for Github in other regions or countries, then edit the server's hosts file. The 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 ESC, and type :wq to save. Test it, and the speed will show a noticeable difference 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.