git clone 出现错误 Could not resolve host: github.com

  • 一、错误原因
  • 二、解决方法
    • 1、解析出域名对应的IP地址
    • 2、把域名和IP地址添加到主机的hosts配置文件中

一、错误原因

git clone 从github上克隆项目的时候出现这个错误,下面我贴出详细的错误信息

mosheng@ms-server:11_DSPR$ git clone https://github.com/cszn/DPSR.git
Cloning into 'DPSR'...
fatal: unable to access 'https://github.com/cszn/DPSR.git/': Could not resolve host: github.com

这个错误的原因可能是github.com 域名没有被主机解析,下面给出具体的解决方法:

二、解决方法

1、解析出域名对应的IP地址

命令:ping 域名地址

mosheng@ms-server:11_DSPR$ ping github.com
PING github.com (13.229.188.59) 56(84) bytes of data.

从上面可以看到,解析出的github的域名的IP地址为:13.229.188.59

2、把域名和IP地址添加到主机的hosts配置文件中

host配置文件的地址:/etc/host

vi /etc/hosts

然后把13.229.188.59 github.com 添加到对应的下方,之后保存退出即可

最后在克隆一下试试吧,应该是惊喜把!!!




♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠

git clone 出现错误 Could not resolve host: github.com相关推荐

  1. git 出现错误 Could not resolve host: github.com 或者 gitlab.com 或者gerrit相关( 自有服务 )...

    原来是因为github.com没有被主机给解析 1.第一步是 ping 你的gitlab 或者 github服务器ip地址 如果每隔几秒有 time = xx.ms 刷新 就证明是通的 2. 编辑 e ...

  2. hexo提交报错 unable to access ‘https://github.com/*/*.github.io.git/‘: Couldn‘t resolve host ‘github.com

    title: >- hexo提交报错 unable to access 'https://github.com//.github.io.git/': Couldn't resolve host ...

  3. 错误集——在线源报未知错误Could not resolve host

    在线源报未知错误Could not resolve host 此时为在线源,可以看到报错内容Could not resolve host,无法解析主机,那么这时ping百度试试,ping: www.b ...

  4. fatal: unable to access ‘https://github.com/.../.git‘: Could not resolve host: github.com解决方法【亲测有效】

    fatal: unable to access 'https://github.com/.../.git': Could not resolve host: github.com解决方法 1.问题原因 ...

  5. git clone 出现fatal: unable to access https://github 解决方法

    git clone 出现fatal: unable to access https://github 类错误解决方法 git clone 遇到问题: ① fatal: unable to access ...

  6. git clone报错 unable to access “https://github.com/xxxxx“

    在克隆github其他人代码时,发现报错:fatal: unable to access 'https://github.com/xxxxx/': Failed to connect to githu ...

  7. 阿里云上git clone公司内网仓库遇到的错误消息 - cannot resolve host

    错误消息: cannot resolve host 本地ping之后将ip地址维护到/etc/hosts里,发现错误消息变成了Connection timed out: 要获取更多Jerry的原创文章 ...

  8. Git解决“Could not resolve host:github.com“

    错误方法:向/etc/hosts添加 192.30.253.112 github.com 这个ip地址已经失效了!!! 正确方法 登陆https://www.ipaddress.com,查询最新git ...

  9. git配置错误 ssh: connect to host github.com port 22: Connection refused

    最近学习到版本管理器git,感觉到它的强大之处,但在与远程仓库链接时出现了配置错误问题,所以就整理了一下我的具体解决步骤,不足之处,望大佬指点. 首先要找到一个.ssh文件 .ssh/ 是一个隐藏文件 ...

最新文章

  1. c++访问控制说明符
  2. QT: 使用qtchooser修改ubuntu默认的qmake版本
  3. 批准Oracle IDM中的特定Web服务
  4. MFC_2.2 编辑框和文本控件
  5. python数值类型的操作_Python学习笔记,数值类型及操作
  6. 解决DatePicker中Appbar icon缺失
  7. vue+three.js开发
  8. Abseil之New Join API
  9. 元素查找(xpath)
  10. Linux安装JDK11
  11. 【论文阅读笔记】GPT三部曲
  12. 6.Vue教程:http://www.jb51.net/Special/874.htm
  13. 记一次锐捷网络虚拟化(VSU)故障处理
  14. 神经网络学习笔记(一) RBF径向基函数神经网络
  15. au cs6七线阁教程 笔记
  16. Educoder -Java面向对象-Java语言之数组(第1关:数组的遍历:给小朋友分糖果)
  17. pdf工具类之添加页码
  18. 是否真的输在起跑线上?
  19. React控制台警告Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until
  20. 南昌理工学院计算机科学与技术排名,南昌理工学院排名2018年下滑5名 在民办大学中实力排全国第38名...

热门文章

  1. CodeForces 396C 树状数组 + DFS
  2. 【转】常用数据结构及复杂度
  3. 强烈推荐Spring Web Flow权威指南
  4. WebBrowser组件和MSHTML
  5. c语言链表删除前一个节点,最简单的链表删除第一个节点时释放内存的问题
  6. python利器怎么编程-OpenCV-Python,计算机视觉开发利器
  7. python在线课程价格-杭州python课程价格
  8. python开发安卓程序-如何使用python开发android应用
  9. python官网下载步骤手机-一招解决:各种版本的Python下载安装教程
  10. python基础知识点总结-Python基础知识总结