Briefly introduce how to modify the host to smoothly/accelerate access to GitHub in mainland China.
The visit status of GitHub in mainland China is Not optimistic, which changes all the time.
The current situation
- Cannot ping github.com
- Cannot use the command line to pull && push normally
- Abnormal access to GitHub assets
Solution
- Open the IP Address website
- Check the IP addresses of the three websites:
github.com
assets-cdn.github.com
github.global.ssl.fastly.net
- Modify the hosts file and add the direct IP of the above three websites
- Ubuntu(Linux) hosts file address:
/etc/hosts
- Windows hosts file address:
C:\Windows\System32\drivers\etc
- Ubuntu(Linux) hosts file address:
- (If it is Windows) Restart or refresh DNS cache
Advantages
No need for software and hardware support such as agents and scientific Internet
Disadvantages
Only corresponding to the current network environment, after the mobile network intervention pointIf it is not easy to useYou need to reconfigure the above process
“Update” For the operator’s floating IP, the best resolution IP may change. If the speed is slow indecisive time, please reconfigure
More
You can use jsDelivr – Open Source CDN to speed up Github file downloads or reduce pollution
Reference
- IP Address
- jsDelivr – Open Source CDN