鍍金池/ 問答/Linux/ Centos 出現(xiàn)Couldn't resolve host Name or s

Centos 出現(xiàn)Couldn't resolve host Name or service not known

今天復(fù)制了我的虛擬機(jī),想要安裝一個(gè)gitlab,結(jié)果用yum安裝的時(shí)候出現(xiàn)了

Couldn't resolve host mirrors.aliyun.com Name or service not known

看字面意思是無法解析域名
但是ping 百度域名可以通,就是yum 安裝時(shí)候無法解析
怎么解決呢?

搜索了一大圈,沒有發(fā)現(xiàn)sf的答案,

回答
編輯回答
你的瞳

找到一個(gè)解決方案,親測(cè)有效:

vim /etc/resolv.conf

然后修改

nameserver 8.8.8.8

醬就可以了

2018年4月18日 11:18