修复Ubuntu(优麒麟)、Windows、MacOS下访问GitHub失败马克

Linux 5个月前 WPONE
3,274 0

无论是Linux还是Windows,访问GitHub都是一大难题。解决这个问题的方法也很简单,就是修改Hosts。我就记录下修改Hosts的方法,免得以后到处查找。

Windows下修改Hosts

  1. 找到下面路径
    C:\Windows\System32\drivers\etc\hosts

    2.用管理员权限打开文件
    3.把文章最后的IP地址复制进去保存即可

MacOS下修改Hosts

  1. 打开终端,使用 vim (也可以用其他编辑器,自行修改即可)修改 Hosts 文件:
    sudo vi /etc/hosts

    2.刷新网络 DNS 缓存:

    sudo killall -HUP mDNSResponder

Ubuntu下修改Hosts

  1. 按下ctrl+alt+T打开命令终端,输入:
    sudo gedit /etc/hosts

    2.添加IP值后保存文件,刷新缓存,在命令终端输入:

    sudo /etc/init.d/networking restart

IP值

# Github Hosts
# update: 2021-03-12
140.82.112.3 github.com
140.82.114.3 github.com
140.82.112.4 github.com
140.82.113.4 github.com
140.82.114.10 nodeload.github.com
140.82.112.10 nodeload.github.com
140.82.112.9 nodeload.github.com
140.82.112.6 api.github.com
140.82.113.5 api.github.com
140.82.113.6 api.github.com
140.82.114.10 codeload.github.com
140.82.112.9 codeload.github.com

185.199.108.153 training.github.com
185.199.109.153 training.github.com
185.199.110.153 training.github.com
185.199.111.153 training.github.com
185.199.108.153 assets-cdn.github.com
185.199.109.153 assets-cdn.github.com
185.199.110.153 assets-cdn.github.com
185.199.111.153 assets-cdn.github.com
185.199.108.153 documentcloud.github.com
185.199.109.153 documentcloud.github.com
185.199.110.153 documentcloud.github.com
185.199.111.153 documentcloud.github.com
185.199.108.154 help.github.com
185.199.109.154 help.github.com
185.199.110.154 help.github.com
185.199.111.154 help.github.com
185.199.108.153 githubstatus.com
185.199.109.153 githubstatus.com
185.199.110.153 githubstatus.com
185.199.111.153 githubstatus.com

199.232.69.194 github.global.ssl.fastly.net
185.199.108.133 raw.github.com
185.199.109.133 raw.github.com
185.199.110.133 raw.github.com
185.199.111.133 raw.github.com
185.199.108.133 raw.githubusercontent.com
185.199.109.133 raw.githubusercontent.com
185.199.110.133 raw.githubusercontent.com
185.199.111.133 raw.githubusercontent.com
185.199.108.133 cloud.githubusercontent.com
185.199.108.133 gist.githubusercontent.com
185.199.108.133 marketplace-screenshots.githubusercontent.com
185.199.108.133 repository-images.githubusercontent.com
185.199.108.133 user-images.githubusercontent.com
185.199.108.133 desktop.githubusercontent.com

185.199.108.133 avatars.githubusercontent.com
185.199.108.133 avatars0.githubusercontent.com
185.199.108.133 avatars1.githubusercontent.com
185.199.108.133 avatars2.githubusercontent.com
185.199.108.133 avatars3.githubusercontent.com
185.199.108.133 avatars4.githubusercontent.com
185.199.108.133 avatars5.githubusercontent.com
185.199.108.133 avatars6.githubusercontent.com
185.199.108.133 avatars7.githubusercontent.com
185.199.108.133 avatars8.githubusercontent.com
# End of the section
版权声明:WPONE 发表于 2021-03-08 19:24:22。
转载请注明:修复Ubuntu(优麒麟)、Windows、MacOS下访问GitHub失败马克 | WPONE

暂无评论

您必须登录才能参与评论!
立即登录
暂无评论...