centos:ping6 未知主机

centos:ping6 未知主机

我有 centos 6.5,启用了 ipv6 并且可以工作(部分)。当我尝试执行“ping6 bin6.it”时,它返回错误“未知主机”:

[root@centos ~]# ping6 bin6.it
unknown host

主机可解析:

[root@centos ~]# host bin6.it
bin6.it has IPv6 address 2607:fd50:1:91b0::b146:11
bin6.it mail is handled by 20 mx02.puttynuts.com.
bin6.it mail is handled by 10 mx01.puttynuts.com.

Ping 到 IP 地址也正常工作:

[root@centos ~]# ping6 2607:fd50:1:91b0::b146:11
PING 2607:fd50:1:91b0::b146:11(2607:fd50:1:91b0::b146:11) 56 data bytes
64 bytes from 2607:fd50:1:91b0::b146:11: icmp_seq=1 ttl=47 time=273 ms
64 bytes from 2607:fd50:1:91b0::b146:11: icmp_seq=2 ttl=47 time=268 ms
64 bytes from 2607:fd50:1:91b0::b146:11: icmp_seq=3 ttl=47 time=268 ms
64 bytes from 2607:fd50:1:91b0::b146:11: icmp_seq=4 ttl=47 time=268 ms
--- 2607:fd50:1:91b0::b146:11 ping statistics ---
5 packets transmitted, 4 received, 20% packet loss, time 4026ms
rtt min/avg/max/mdev = 268.293/269.715/273.367/2.215 ms

怎么了?

按请求添加:

[root@centos ~]# cat /etc/resolv.conf
# Generated by NetworkManager
search mydomain.com
nameserver 192.168.5.34

[root@centos ~]# grep hosts /etc/nsswitch.conf
#hosts:     db files nisplus nis dns
#hosts:      files mdns4_minimal [NOTFOUND=return] dns
#hosts:      dns files mdns4_minimal
hosts:      files dns mdns4

答案1

host直接检查 DNS,同时ping6(和ping)通过名称服务交换机 (NSS) 将名称解析为 IP 地址。

检查/etc/nsswiitch.conf并确保您在条目dns上有hosts:类似于以下内容的内容:

hosts:      files dns myhostname

相关内容