Could not resolve hostname : Name or service not known
时间: 2023-09-03 22:14:24 浏览: 255
mysql could not be resolved: Name or service not known
问题:Could not resolve hostname : Name or service not known
回答: 当出现"Could not resolve hostname : Name or service not known"错误时,表示系统无法解析主机名或服务名。解决此问题的方法有两种。一种是根据网络配置文件生成/etc/resolv.conf文件,可以使用systemctl restart NetworkManager命令来自动生成。在CentOS 7中,默认的网络配置文件是/etc/sysconfig/network-scripts/ifcfg-eth0。然而,如果你的网卡配置文件不是ifcfg-eth0,而是ifcfg-ens33等其他文件,你可以直接在/etc/resolv.conf中手动添加正确的DNS信息。这样就可以解决"Could not resolve hostname : Name or service not known"错误。<span class="em">1</span><span class="em">2</span>
#### 引用[.reference_title]
- *1* *2* [Couldn't resolve host或者Name or service not known](https://blog.csdn.net/maoyuanming0806/article/details/79029584)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文