简体   繁体   English

Linux centos:ping显示任何域名的未知主机

[英]Linux centos : ping displays unknown host for any domain name

Ping displays unknown host for any domain name. Ping显示任何域名的未知主机。

It worked before this time true!! 它在此之前工作真实!!

Ping works for ip address but fails for domain names. Ping适用于IP地址,但域名失败。

Can any one help me? 谁能帮我?

Check what's in /etc/resolv.conf . 检查/etc/resolv.conf If there is no "nameserver" specified, you have to do that in order to resolve domains. 如果未指定“名称服务器”,则必须执行此操作才能解析域。 Example: 例:

nameserver dns1.domainname.com
nameserver dns2.domainname.com

or you can use Google's public DNS servers: 或者您可以使用Google的公共DNS服务器:

nameserver 8.8.8.8   
nameserver 8.8.4.4

(1) edit /etc/resolv.conf, add (1)编辑/etc/resolv.conf,添加

nameserver dns1.domainname.com nameserver dns1.domainname.com

nameserver dns2.domainname.com nameserver dns2.domainname.com

(2) another reason may due to /etc/nsswitch.conf (2)另一个原因可能是由于/etc/nsswitch.conf

add dns in the hosts: xxx 在主机中添加dns:xxx

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM