Unable to access Github solution

By modifying the content in the local hosts file, you can successfully access github

The operation is very simple, modify the hosts file

1. Find the hosts file

The location of the hosts file in each system is different. The details are as follows:
Windows system: C:\Windows\System32\drivers\etc\hosts
Linux system: /etc/hosts
Mac (Apple Computer) system: /etc/hosts
Android (Android) ) System: /system/etc/hosts
iPhone (iOS) System: /etc/hosts

2. Open the hosts file

Windows uses Notepad.
Linux and Mac use Root permissions: sudo vi /etc/hosts
iPhone and iPad must be jailbroken, Android must be root

3. Copy the content of the following code to the end of the hosts file of the device

# GitHub520 Host Start
185.199.108.154               github.githubassets.com
140.82.113.22                 central.github.com
185.199.108.133               desktop.githubusercontent.com
185.199.108.153               assets-cdn.github.com
185.199.108.133               camo.githubusercontent.com
185.199.108.133               github.map.fastly.net
199.232.69.194                github.global.ssl.fastly.net
140.82.113.3                  gist.github.com
185.199.108.153               github.io
140.82.114.4                  github.com
140.82.112.6                  api.github.com
185.199.108.133               raw.githubusercontent.com
185.199.108.133               user-images.githubusercontent.com
185.199.108.133               favicons.githubusercontent.com
185.199.108.133               avatars5.githubusercontent.com
185.199.108.133               avatars4.githubusercontent.com
185.199.108.133               avatars3.githubusercontent.com
185.199.108.133               avatars2.githubusercontent.com
185.199.108.133               avatars1.githubusercontent.com
185.199.108.133               avatars0.githubusercontent.com
185.199.108.133               avatars.githubusercontent.com
140.82.113.9                  codeload.github.com
52.217.88.28                  github-cloud.s3.amazonaws.com
52.216.238.99                 github-com.s3.amazonaws.com
52.216.26.252                 github-production-release-asset-2e65be.s3.amazonaws.com
52.217.101.68                 github-production-user-asset-6210df.s3.amazonaws.com
52.217.48.84                  github-production-repository-file-5c1aeb.s3.amazonaws.com
185.199.108.153               githubstatus.com
64.71.168.201                 github.community
185.199.108.133               media.githubusercontent.com

# Update time: 2022-11-01T12:00:00+08:00
# Star me GitHub url: https://github.com/521xueweihan/GitHub520
# GitHub520 Host End

The above content will be updated automatically and regularly, so there is no need to worry about the Update time here.

4. Activate the hosts file to take effect

In most cases, it will take effect directly. If it does not take effect, you can try the following method to refresh the DNS:

Windows: Enter in the CMD window: ipconfig /flushdns

Linux command: sudo rcnscd restart

Mac instruction: sudo killall -HUP mDNSResponder

Tips: If the above method is invalid, you can try restarting the machine.

Guess you like

Origin blog.csdn.net/weixin_46398647/article/details/127635175