国内访问github.com经常打不开,无法访问。

Connection reset by 20.205.243.166 port 22
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

解决Github打不开办法

打开网站http://tool.chinaz.com/dns/ ,在A类型的查询中输入 github.com,找到最快访问的ip地址,并复制下来。

修改系统文件的host文件

在hosts文件中添加:
# localhost name resolution is handled within DNS itself.# 127.0.0.1 localhost# ::1 localhost20.205.243.166 github.com
补充知识:如何修改hosts文件?
1、右键点击hosts文件,选择复制,然后粘贴到桌面上。2、右键点击桌面上的hosts文件,选择“用记事本打开该文件”,修改之后点击【文件】>【保存】完成修改。3、将修改好的hosts文件,重新复制到 C:\Windows\System32\drivers\etc ,覆盖原来的hosts文件。

3.在 CMD 命令行中执行下面语句 来刷新 DNS,重启浏览器之后就能进入Github 网址。

 ipconfig/flushdns

补充:终极方法

记住三个网站:

github网址查询:https://ipaddress.com/website/github.com

github域名查询:https://ipaddress.com/website/github.global.ssl.fastly.net

github静态资源ip:https://ipaddress.com/website/assets-cdn.github.com

1、打开hosts文件(C:\Windows\System32\drivers\etc)

2、然末尾放入一下两个 IP 地址:

GitHub Start
140.82.114.4 github.com
199.232.69.194 github.global.ssl.fastly.net
# GitHub End

保存退出

3、在 CMD 命令行中执行下面语句 来刷新 DNS,重启浏览器之后就能进入Github 网址。

ipconfig/flushdns
然后直接访问