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

阿里的DNS。
223.6.6.6
https://223.6.6.6/dns-query

参考文章
- 解决个困扰很久的问题:ssh: connect to host github.com port 22: Connection refused https://zhuanlan.zhihu.com/p/643193388

浙公网安备 33010602011771号