tech-net archive


bsd licensed mdnsd project


I've seen the interest in a mdns implementation on the NetBSD Projects Page:

But afaik NetBSD has apple's mdnsd already in base, correct ?

Anyway, I'm writing a bsd licensed mdnsd for OpenBSD, I suppose it could
be used in NetBSD without much effort.

If you're still interested in having a bsd licensed daemon here is the
original post do, it's far from usable, but it works

== My original post to ==

Hi there,

Some of you may already know that I'm working on an open mdns
implementation, avahi is gpl and apple's mdnsd is apache2, so that
leaves us with no choice. Some devs have expressed interest in having
a mdns implementation, I thought it would be fun so here it is :P.

So I've started mdnsd, if you guys like it, maybe it can be called
OpenMDNSd in the future.

The daemon is OpenBSD-like, that is, libevent, imsg framework and all,
most code has been based on ripd/ospfd, style(9) is respected.

For those who are unfamiliar with mdns:
What is MulticastDNS and DNS Service Discovery:
MDNS Is a way to resolve/publish DNS records using multicast. DNS-SD
is a way to do proper network browsing using DNS, be it basic unicast
or multicast dns, you can for example browse things like "which are
the webpages being served in this network?", "who's serving NTP in
this network?" and so on.
I indent to fully support mdns/dns-sd.

For simple mdns name lookups (A records) not very much is needed, but
mdns is a multicast protocol so it must not be chatty, therefore the
draft specifies a full cache coherency and ways to prevent unnecessary
traffic, because of that we need a daemon, which should be the only
responder/querier, he must keep all learned records and answer all
published records. (Multiple responders/queriers is evil)

Applications that make use of mdns, should talk with the daemon
through the control socket (there is a bare bone implementation in
mdns_api.c which is used by mdnsctl).

Mdnsd is this daemon, applications connect through it's unix domain
socket in order to publish and lookup records/services.  Mdns works on
the .local domain, so in order for libc to resolve .local names, my
proposal is to add another entry in the "lookup" keyword for mdns, so
that any query to a .local ending name will be sent to mdnsd.

What's working so far ?
      * Mdnsctl program to interact with the daemon, lookup and
      lookupaddr are fully functional. This is in the same fashion as
      ripctl and friends...
      * Publishing of hostname.
      * Answering/Quering for hostnames.
      * Quering reverse lookup (address lookups).
      * Probing for unique names.
      * Caching, expiring and most of cache coherency.
      * Listen to network events though AF_ROUTE and republish
      records when needed.
      * That's around 5300 lines.

What's missing:
      * Support for DNS-SD.
      * Known answer suppression.
      * Name compression.
      * Support for sending records in more than one packet.
      * Name conflict resolution
      * Libc integration.
      * Shit loads of stuff.

Where to get:
     I'm hosting it at

     You need to make sure user and group _mdnsd gets created, also
     make sure to enable multicast in your host, see netstart(7) for
     a detailed description. It must be run as root but it will drop

I'm having a great time coding this, I hope you all enjoy as much as I

Sorry for the long post.

Christiano Farina HAESBAERT
Do NOT send me html mail.

Home | Main Index | Thread Index | Old Index