解决Git ‘unable to resolve host address ‘github.com‘、 ‘raw.githubusercontent.com‘

1. 登陆https://www.ipaddress.com,查询最新地址。
2. 向/etc/hosts添加

比如当前我查到的是

185.199.110.133 raw.githubusercontent.com
140.82.112.4 github.com

在这里插入图片描述
重新打开git就好了。


注意,网上常搜到的下面这个ip已失效

192.30.253.112  github.com

补充:对于Windows系统下,可能上述还不起作用。需要再将C:\Windows\System32\drivers\etc下的hosts文件,也做上述改动即可解决。【自己是该情况】

猜你喜欢

转载自blog.csdn.net/Dust_Evc/article/details/127586014