无法连接github

  1. 登录IP查询网,查询github.com的IP地址

  2. 添加映射到C:\Windows\System32\drivers\etc\hosts文件中:(Mac用户:/etc/hosts)

    140.82.113.3 github.com
    199.232.5.194 github.global.ssl.fastly.net
    192.30.253.120 codeload.github.com

  3. 打开cmd,ping github,可通即可用。

但不知道为什么,虽然使用这个映射可以打开github网址,但在npm安装时却一直报错“GET 400 github.com”
我还是换了一些别的映射,虽然没法打开网址,但可以install时正常连接下载。这里一股脑都丢上来吧。

# GitHub Start
192.30.253.113 github.com
192.30.253.112 github.com
# 140.82.113.4 github.com
207.97.227.239 github.com
207.97.227.243 github.com
185.199.108.153 github.github.io
151.101.72.133 assets-cdn.github.com
151.101.185.194 github.global.ssl.fastly.net
192.30.253.118 gist.github.com
192.30.253.119 gist.github.com
151.101.100.133 assets-cdn.github.com
151.101.100.133 raw.githubusercontent.com
151.101.100.133 gist.githubusercontent.com
151.101.100.133 cloud.githubusercontent.com
151.101.100.133 camo.githubusercontent.com
151.101.100.133 avatars0.githubusercontent.com
151.101.100.133 avatars1.githubusercontent.com
151.101.100.133 avatars2.githubusercontent.com
151.101.100.133 avatars3.githubusercontent.com
151.101.100.133 avatars4.githubusercontent.com
151.101.100.133 avatars5.githubusercontent.com
151.101.100.133 avatars6.githubusercontent.com
151.101.100.133 avatars7.githubusercontent.com
151.101.100.133 avatars8.githubusercontent.com
# GitHub End
posted @ 2020-07-07 17:20  Shaw_喆宇  阅读(3170)  评论(1编辑  收藏  举报