7

Could not resolve host: github.com的解决方案

 1 year ago
source link: https://blog.csdn.net/yjn18021006815/article/details/118568048
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Could not resolve host: github.com的解决方案

original.png
yjn18021006815 newCurrentTime2.png 于 2021-07-08 10:28:05 发布 articleReadEyes2.png 12555
文章标签: git

描述:
新装的ubuntu2004,git clone命令时遇到标题描述问题。
发现可以上网,但是ping github.com会出错
解决方法:
第一步、
1、打开hosts文件

sudo vim /etc/hosts

2、在添加github.com域名(localhost下添加即可)

140.82.114.4    github.com

3、现在尝试ping github.com发现可以ping通
就可以了,不行换个域名,域名查找网站可以去知乎搜一下

第二步、可以使用git clone了,但是会发现很慢,解决方法
把com换成zygxsq.cn
比如

git clone https://github.com/verilator/verilator

https://github.zygxsq.cn/verilator/verilator
文章知识点与官方知识档案匹配,可进一步学习相关知识
Git技能树首页概览4501 人正在系统学习中

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK