ssh:could not resolve hostname XXX:Temporary failure in name resolution

今天使用虚拟机提交github项目发现出现:git

ssh:could not resolve hostname XXX:Temporary failure in name resolution

先是ping了一下github.com,发现虚拟机内的Linux访问不了这个网站github

后来去站点查了一下网站的ipvim


发现绑定了不少ip,我先是逐步尝试ping每一个ip
bash

先是ping了第一个140.82.114.4发现ping通了服务器

怀疑github绑定的域名变了。ssh

因此就怀疑是个人系统解析dns出了错误,使用的dns服务器没有更新网站

因此我就在hosts文件里手动定向这个ipcode

sudo vim /etc/hosts

在末尾输入:blog

140.82.114.4 github.com

在次ping:dns

ping通啦

在使用github命令提交便可~

顺便分享一个查询域名的网站:

https://www.ip138.com/

相关文章
相关标签/搜索