avahi-daemon – The Avahi mDNS/DNS-SD daemon
The Avahi mDNS/DNS-SD daemon implementing Apple’s ZeroConf architecture (also known as “Rendezvous” or “Bonjour”). The daemon registers local IP addresses and static services using mDNS/DNS-SD and provides two IPC APIs for local programs to make use of the mDNS record cache the avahi-daemon maintains. First there is the so called “simple protocol” which is used exclusively by avahi-dnsconfd (a daemon which configures unicast DNS servers using server info published via mDNS) and nss-mdns (a libc NSS plugin, providing name resolution via mDNS). Finally there is the D-Bus interface which provides a rich object oriented interface to D-Bus enabled applications.
一同事的本本连接服务器很慢,感觉像是在做反向解析。服务器上的SSH Daemon我已经配置了UseDNS no,所以应该不是服务器端的问题。后来发现ping一个域名也很慢,加上-n参数就很快。
我们刚搬机房的时候,服务器上也发生过类似的事情。不过当时是从任何地方ping机房的服务器都会很慢。
strace了一下ping www.bsdmap.com
发现要调用avahi-daemon:
connect(4, {sa_family=AF_FILE, path=”/var/run/avahi-daemon/socket”}, 110) = 0
于是,停掉avahi-daemon服务。一切恢复正常!看来是avahi-daemon出了问题。
avahi-daemon是一个苹果电脑上的“零配置(跟网络有关)”构架的实现。个人理解像是桌面系统上东西,服务器上应该用不着。