[avahi] keep avahi-browse-list uptodate

Lennart Poettering lennart at poettering.net
Sat Apr 18 15:43:02 PDT 2009

On Thu, 16.04.09 16:25, Florian Erfurth (f.erfurth at reel-multimedia.com) wrote:

> Hi,
> Question A:
> if somewhere a host is (un)plugged from/to network (without shutdown or
> stopping network). It takes very long till the host (and its services)
> disappears from avahi-browser. I can resolve the problem by doing following:
> /etc/init.d/avahi-daemon restart
> Is this the proper way to refresh avahi-browser-list?

No, certainly not.

> Question B:
> Is there a way to reduce the "Timeout", till a host will be removed from
> avahi-browser-list? (same example like Question A if I (un)plug a remote 
> Host)

Kind of. The registrants can control this by setting the TTL of the
records they register. In avahi_entry_group_add_record() this its the
'ttl' parameter. That function can be used to register 'raw' RRs. For
the higher level calls such as avahi_entry_group_add_service() you
don't have this fine-grained control.

It is not recommended to play games with the TTL however. You have to
balance out the traffic imposed on the network with the delay it takes
until services disappear from the network when the registering machine
died without sending goodbye packets. 

Never forget: mDNS is not a reliable protocol. And we don't want fool
anyone into believing it was. 


Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net         ICQ# 11060553
http://0pointer.net/lennart/           GnuPG 0x1A015CC4

More information about the avahi mailing list