ssh: connect to host github.com port 22: Connection refused fatal: Could not read from remote repository.

背景

这次来回切换节点,换直连,等等任何方式都没有起作用,于是又上网搜。

原因

> nslookup github.com
服务器:  UnKnown
Address:  fe80::ced8:43ff:fe7f:1790

非权威应答:
名称:    github.com
Address:  127.0.0.1

github.com域名被dns污染了,解析到了127.0.0.1这个本地地址,没有响应是理所应当的。

解决

网络上提供的解决方法基本上是改hosts,但是我不太喜欢改这玩意。

DoH

image
阿里的DNS。

223.6.6.6
https://223.6.6.6/dns-query

image

参考文章

  1. 解决个困扰很久的问题:ssh: connect to host github.com port 22: Connection refused https://zhuanlan.zhihu.com/p/643193388
posted @ 2025-10-14 00:52  魂祈梦  阅读(86)  评论(0)    收藏  举报