在idea使用GitHub账号、Copilot异常

在idea使用GitHub账号、Copilot异常
登录GitHub显示
Invalid authentication data.Connection refused: connect

或者副驾驶显示
Failed to initiate the GitHub login process. Please try again.

一般网上的方法推荐使用token登录,或者降级副驾驶
经过研究,其实就是DNS污染
修改hosts(C:\Windows\System32\drivers\etc\hosts),添加以下参数。ipaddress.com可以最新查询地址
一定要添加api.github.com
必须添加api.github.com的ip

# Github
140.82.114.3 github.com
199.232.69.194 github.global.ssl.fastly.net
140.82.114.5 api.github.com

之后cmd登陆

ipconfig /flushdns

当浏览器可以裸连github.com,表示dns刷新成功,这样所有问题都解决了。

 


THE END
喜欢就支持一下吧
点赞6赞赏 分享
评论 共2条
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片
    • 头像梧桐0