7
Could not resolve host: github.com的解决方案
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.
Could not resolve host: github.com的解决方案
描述:
新装的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
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK