preface
The best time to plant a tree was ten years ago, followed by now.
why
Why is slow? Github’S CDN was blocked by a wall.
The solution
Bypassing DNS resolution and binding host directly locally, this method can also speed up other websites that are slow to access due to the blocking of CDN.
The principle of
Locate the IP address corresponding to the Github domain name and add it to the local host. This eliminates the need to query the DNS address for each GIHUB request. This method can also be used for other walled addresses, but the problem is that this method must add a corresponding IP address for each domain name. It’s tedious.
Specific operation
Manual DNS search for IP addresses
Visit the ipAddress website to view the IP address corresponding to the website domain name. You can enter the IP address to view the IP address. It is a tool for querying domain name mapping.
- The corresponding IP query github.global.ssl.fastly.net: 151.101.113.194.
- Example Query the IP address of github.com: 192.30.253.112.
- The IP address of github-cloud.s3.amazonaws.com is 52.216.227.168.
Modifying the host file
Open the host file in C:\Windows\System32\drivers\etcCopy the code
151.101.113.194 github.global.ssl.fastly.net
192.30.253.112 github.com
52.216.227.168 github-cloud.s3.amazonaws.com
Copy the code
Save files yo (win10 please open notepad with administrator identity edit).
The refresh DNS
- Window: CMD runs ipconfig/flushdns
- MAC run: sudo dscacheutil -flushCache
- Restart your browser and try. You’re done!
conclusion
Stay tuned for DNS resolution rules in the next article