avahi icon indicating copy to clipboard operation
avahi copied to clipboard

failure in collision detection

Open hadmut opened this issue 2 years ago • 1 comments

Hi, using Ubuntu 22.04 and avahi-daemon 0.8-5ubuntu5, I ran into a problem with collision detection.

I'm in a network with a poor router, that offers DHCP, but doesn't register DHCP into a DNS zone, thus requiring the machines to use mDNS in order to find each other.

Avahi only occassionally worked. I found that it issues lots of error messages like Host name conflict, retrying with hostname-2521 i.e. goes into an endless loop of collisions and counting up the hostname.

The first problem is that it does not tell where the collision came from and what kind of collision (same hostname or same ip-derived name), which makes debugging really difficult. It should tell the MAC and IP where the colliding names came from in order to give the admin a chance to fix the problem (if there is any).

The second is, that it does not make any sense to go into an endless loop without error detection or limit, thus wasting cpu time, confusing the network.

The third problem is that I did not find an option to stop this. I am the master of my network, and not avahi, so it should be possible to override that collision detection and have it just use the host name I have assigned, and not any random other. It is a nightmare in network administration and debugging, if a machine randomly changes its hostname. Actually, that's a no-go and can cause severe trouble in important networks, e.g. emergency services or others that just need to work. It can render the admin just unable to get the network running.

The fourth problem is, that I did not find any colliding answers on the network, but – due to a lack of documentation – configuration flaw. Since I was trying to figure out why avahi is taking so long after boot to answer requests I had set the MulticastDNS=yes in /etc/systemd/resolved.conf, which may have led to two competing mdns services on the machine, and maybe have triggered the collision detection. Even if so, it is technically wrong to detect a collision if someone else (either a second daemon on the same machine or any other machine) gives the same answer avahi would have given, i.e. if there is no collision, just superfluos, but correct answers.

The (possibly) fifth problem could be (I'm not sure due to insufficient log messages), that avahi doesn't correctly deal with net.ipv6.conf.enp1s0.use_tempaddr = 2 and might misunderstand it's own, but changing IPv6-addresses as a collision.

And the sixth problem is that the man page does not tell anything about collision detection or whether it is possible to have both avahi and systemd-resolve for mdns on the same machine.

regards Hadmut

hadmut avatar Jan 12 '23 09:01 hadmut

Related to issue #117

pemensik avatar Jun 23 '23 15:06 pemensik