centos:ping6未知主机


3

我有启用了ipv6的centos 6.5,并且正在工作(部分)。当我尝试执行“ 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

Answers:


1

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

检查/etc/nsswiitch.conf并确保您具有dnshosts:条目,类似于以下内容:

hosts:      files dns myhostname
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.