Has any work been done to add mDNS support to c-ares? (For more info,
see http://www.multicastdns.org/ and http://en.wikipedia.org/wiki/MDNS )
One option I've investigated is adding support for glibc's NSS mechanism
("Name Service Switch"). This would allow resolution mechanisms to be
added without modifying c-ares. Furthermore, it would enable c-ares
apps to respect the behavior specified in /etc/nsswitch.conf (the lack
of which might be a source of confusion and frustration for users and
The primary disadvantage is that the NSS mechanism doesn't define any
asynchronous lookups, so c-ares' behavior would degrade to synchronous.
However, since NSS does nothing to restrict what symbols plugins
contain, there's no reason c-ares couldn't define and attempt to use
some asynchronous extensions, before falling back to synchronous ones.
You can read more about NSS, here:
An attractive aspect of this approach is that there's already a NSS
plug-in that supports mDNS:
Another benefit of going the plug-in route becomes apparent, as one
investigates the mDNS protocol - it relies somewhat heavily on both
passive and active caching, in order for network efficiency to scale
well with the number of devices and lookups. This means each client
machine would ideally run its own daemon that caches lookups for local
programs. Adding support via plug-ins has the benefit that any
dependency on a specific daemon would be pushed out to the plug-in,
allowing users to choose their own plug-in/daemon pair (FYI, nss-mdns
supports the Avahi mDNS daemon - http://avahi.org/ ).
Of course, the other option would be to add direct support for mDNS.
This has the disadvantage of either being inefficient (due to no
persistent, passive caching) or adding a dependency on a particular mDNS
I'm already half way down the path of adding NSS support, but I'm not
sure if/when I'll have time to finish.
Received on 2007-02-15