[avahi] libnss-mdns + avahi-daemon has strange behavior with
many network interfaces
cscm at meuh.dyndns.org
Tue Oct 10 12:52:02 PDT 2006
> On Fri, 06.10.06 23:52, Christophe Nowicki (cscm at meuh.dyndns.org) wrote:
>> I'am running avahi-daemon (version 0.6.13) on an computer with many
>> interfaces :
>> # ifconfig | grep ^eth | wc -l
> Are this real interfaces, or just "alias" interfaces? The output of
> "ip link" is much more useful than ifconfig in this case.
There are aliasies, there is only one real interface :
2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:11:95:25:db:0c brd ff:ff:ff:ff:ff:ff
>> This computer has only one "good" network address (other addresses are
>> used by vservers) :
> What do you mean by "good"?
avahi-daemon is running on this machine and there is only one address.
> Please check syslog. avahi-daemon dumps the available interfaces and
> ip addresses there and selects the "best" possible address for each
> interfaces and uses it to publish the A record.
Running avahi-daemon with the --debug param give the fallowing output :
Found user 'avahi' (UID 108) and group 'avahi' (GID 107).
Successfully dropped root privileges.
chroot.c: chroot() helper started
avahi-daemon 0.6.13 starting up.
WARNING: No NSS support for mDNS detected, consider installing nss-mdns!
Successfully called chroot().
Successfully dropped remaining capabilities.
chroot.c: chroot() helper got command 02
Loading service file /services/ssh.service.
New relevant interface eth0.IPv4 for mDNS.
Joining mDNS multicast group on interface eth0.IPv4 with address
Network interface enumeration completed.
Registering new address record for 192.168.42.55 on eth0.
Registering new address record for 192.168.42.32 on eth0.
Registering new address record for 192.168.42.6 on eth0.
Registering new address record for 192.168.42.25 on eth0.
Registering new address record for 192.168.42.18 on eth0.
Registering new address record for 192.168.42.14 on eth0.
Registering new address record for 192.168.42.17 on eth0.
Registering new address record for 192.168.42.12 on eth0.
Registering new address record for 192.168.42.13 on eth0.
Registering new address record for 192.168.42.23 on eth0.
Registering new address record for 192.168.42.62 on eth0.
Registering new address record for 192.168.42.29 on eth0.
Registering new address record for 192.168.42.21 on eth0.
Registering new address record for 192.168.42.15 on eth0.
Registering new address record for 192.168.42.31 on eth0.
Registering new address record for 192.168.42.1 on eth0.
Registering HINFO record with values 'I686'/'LINUX'.
Server startup complete. Host name is meuh.local. Local service cookie is
Service "Remote Terminal on meuh" (/services/ssh.service) successfully
> "best" in this case means that it uses an ip address with global scope
> and outside of the ipv4ll range if existant, otherwiser falls back to
> local scope/ipv4ll.
> avahi will only use one ip address per interface.
>> # ifconfig eth0
>> eth0 Lien encap:Ethernet HWaddr 00:11:95:25:DB:0C
>> inet adr:192.168.42.1 Bcast:192.168.42.255
>> mDNS services publishing is working very well :
>> $ avahi-browse -a -r
>> = eth1 IPv4 meuh [00:11:95:25:db:0c] Workstation
>> hostname = [meuh.local]
>> address = [192.168.42.1]
>> port = 
>> txt = ["org.freedesktop.Avahi.cookie=1478531472"]
>> But libnss-mdns does not resolve the *good* address :
>> $ getent hosts meuh.local
>> 192.168.42.55 meuh.local
>> $ getent hosts meuh.local
>> 192.168.42.32 meuh.local
>> $ getent host meuh.local
>> 192.168.42.31 meuh.local
>> The network address returned by libnss-mdns is randomely selected within
>> the network addresses used by the server.
> If you compiled nss-mdns with avahi support (and passed the right
> paths for avahi-daemons socket), than the results of "getent host" and
> avahi-resolve-host-name should be identical.
I am using libnss-mdns version 0.7 from debian, this package is build with
the --enable-avahi param. Is that enough?
> Yes, it is not deterministic which IP address is returned by "getent
> host"/avahi-resolve-host-name. This is not a bug.
it's very strange, because in my case I've published the ssh services on
that machine. And sshd is running only on the eth0:22 interface.
If libnss-mdns return a random address for this machine, publishing a
service on a computer with more than one interface is useless?
>> I think that would be nice to bind the avahi-daemon on a network
>> with a directive in the avahi-daemon.conf file.
> Yes, this is an often requested feature and is on our TODO list,
> however, until now noone bothered to implement this.
I understand, patchs are welcome ? :)
> Actually, it's amazing how often people ask this same question over
> and over. We've added an item to our FAQ list, but apparently noone
> even bothers to check that list first...
The -multicast param does not work on aliases :
# ifconfig eth0:0webserver -multicast
Warning: Interface eth0:0webserver still in MULTICAST mode.
More information about the avahi