https://blog.csdn.net/hanchao5272/article/details/79393393

1.错误信息

之前github都能用,但是今天git clone的时候居然连不上了,报错信息如下:

$ git clone git@github.com:hanchao5272/myreflect.git
Cloning into 'myreflect'...
ssh_dispatch_run_fatal: Connection to 13.250.177.223 port 22: Software caused connection abort
fatal: Could not read from remote repository. Please make sure you have the correct access rights
and the repository exists.

2.错误分析

于是怀疑是连接不到github.com了,首先在cmd窗口中,尝试ping一下百度

C:\Users\hanchao>ping www.baidu.com

正在 Ping www.a.shifen.com [61.135.169.121] 具有 32 字节的数据:
来自 61.135.169.121 的回复: 字节=32 时间=24ms TTL=57
来自 61.135.169.121 的回复: 字节=32 时间=45ms TTL=57
来自 61.135.169.121 的回复: 字节=32 时间=26ms TTL=57
来自 61.135.169.121 的回复: 字节=32 时间=22ms TTL=57 61.135.169.121 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 22ms,最长 = 45ms,平均 = 29ms

说明网络连接正常。


然后再ping一下github.com

C:\Users\hanchao>ping github.com

正在 Ping github.com [13.229.188.59] 具有 32 字节的数据:
请求超时。
请求超时。
请求超时。
请求超时。 13.229.188.59 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 0,丢失 = 4 (100% 丢失),

确实ping不通。

因此怀疑是:本地DNS无法解析导致的。

3.错误解决

打开C:\Windows\System32\drivers\etc\hosts,内容如下:

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host # localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
0.0.0.0 account.jetbrains.com

发现:确实没有github.com的解析 
在文件末尾添加如下内容,并保存:

192.30.255.112  github.com git
185.31.16.184 github.global.ssl.fastly.net

重启cmd窗口,继续ping一下github.com

正在 Ping github.com [192.30.255.112] 具有 32 字节的数据:
来自 192.30.255.112 的回复: 字节=32 时间=311ms TTL=48
来自 192.30.255.112 的回复: 字节=32 时间=365ms TTL=48
来自 192.30.255.112 的回复: 字节=32 时间=376ms TTL=48
来自 192.30.255.112 的回复: 字节=32 时间=353ms TTL=48 192.30.255.112 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 311ms,最长 = 376ms,平均 = 351ms
  • 说明,本机已经能够正常解析github.com这个域名了。至此,问题解决

github.com连接超时的更多相关文章

  1. Ruby http/net 中连接超时问题

    下面在调用币安的接口时,经常会卡住,设置连接超时也不会抛出异常,代码如下(默认连接超时为nil, 参考:https://github.com/ruby/ruby/pull/269): require ...

  2. golang中mysql建立连接超时时间timeout 测试

    本文测试连接mysql的超时时间. 这里的"连接"是建立连接的意思. 连接mysql的超时时间是通过参数timeout设置的. 1.建立连接超时测试 下面例子中,设置连接超时时间为 ...

  3. 关于MySQL的wait_timeout连接超时问题报错解决方案

    bug回顾 : 想必大家在用MySQL时都会遇到连接超时的问题,如下图所示: ### Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsExce ...

  4. Linux Vsftpd 连接超时解决方法(被动模式)

    http://blog.csdn.net/qq_15766181/article/details/46554643 使用 FileZilla FTP Client 连接 Vsftpd FTP,在没有配 ...

  5. 修改tnsnames.ora文件中配置内容中的连接别名后,连接超时解决办法

    1.tnsnames.ora文件中配置内容中的连接别名:由upaydb修改为IP地址 2.连接超时 定位原因: PLSQL登录界面的数据库列表就是读的tnsname.ora中连接的别名,这个文件中连接 ...

  6. SQL Server 连接超时案例一则

    上周六,一工厂系统管理员反馈一数据库连接不上,SSMS连接数据库报"连接超时时间已到.在尝试使用预登录握手确认时超过了此超时时间.......", 如下截图所示: 另外远程连接也连 ...

  7. SSRS报表连接超时的问题

    这段时间遇到一个问题就是ReportService 中采用了远程连接的报表偶尔会断开连接,导致报表导出异常,查阅了很多资料,几天来就是断断续续的终于解决了这个问题,下面把一些解决的点一一展示出来,便于 ...

  8. Linux Vsftpd 连接超时解决方法

    Linux Vsftpd 连接超时解决方法 2013-11-13 10:58:34|  分类: 默认分类|举报|字号 订阅     解决方法(http://www.lingdus.com/thread ...

  9. (转)hbase master挂掉-zookeeper连接超时原因

    link:http://www.51testing.com/?uid-445759-action-viewspace-itemid-812467 并行运行hbase删表,建表操作,多个表多个regio ...

随机推荐

  1. Java与设计模式之单例模式(上)六种实现方式

           阎宏博士在<JAVA与模式>中是这样描述单例模式的:作为对象的创建模式,单例模式确保某一个类只有一个实例,而且自行实例化并向整个系统提供这个实例.这个类称为单例类.      ...

  2. 在Mac如何启动MySQL

    安装好MySQL服务后(安装步骤可以参考系列经验1).打开“系统偏好设置”,单击下端的“MySQL”图标. 2 在“MySQL”对话框中,单击“启动MySQL服务”按钮. 3 在弹出的窗口中,输入管理 ...

  3. c# lock TransactionScope

    c# lock TransactionScope TransactionOptions option = new TransactionOptions(); //option.IsolationLev ...

  4. FIS3

    #npm install -g cnpm --registry=https://registry.npm.taobao.org#cnpm install -g fis3 npm install fis ...

  5. frp ssh反向代理配置使用

    本质是一个内网反向代理工具,需要一个vps配合,因为要外网ip. 主页: https://github.com/fatedier/frp 1.服务端(VPS) 可以用下面的一键安装脚本,也可以用主页上 ...

  6. 阿里druid连接池监控数据自定义存储

    如何将druid连接池监控到的sql执行效率,连接池资源情况等进行持久化存储,方便系统运维分析优化,以下案例初步测试成功. 第一部: 新建MyDruidStatLogger类实现接口 extends ...

  7. xss payload大全

    刚好刚才在fuzz一个站的时候用到,就从笔记里抛出来了. code: (1)普通的XSS JavaScript注入 <SCRIPT SRC=http://3w.org/XSS/xss.js> ...

  8. flutter 打开应用的闪屏动画

    import 'package:flutter/material.dart'; import 'package:flutter_app/pages/SplashScreen.dart'; void m ...

  9. ISO/IEC 9899:2011 条款6.8——语句和语句块

    6.8 语句和语句块 语法 1.statement: labeled-statement compound-statement         expression-statement         ...

  10. C2678 二进制“>>”: 没有找到接受“std::stringstream”类型的左操作数的运算符(或没有可接受的转换)

    C2678 二进制“>>”: 没有找到接受“std::stringstream”类型的左操作数的运算符(或没有可接受的转换)