Ooops forgot to mention. Use it only for one interface, I've not tested with multiple interfaces:
example: ./mdnsd -d em0 too lookup a hostname: ./mdnscltl lookup hostname.local I've just commited two diffs that would case an infinite loop while parsing SRV records. Any feedback would be nice :D. 2010/3/3 Christiano F. Haesbaert <[email protected]>: > 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. > > Background: > 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 > http://github.com/haesbaert/mdnsd > > 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 > privileges. > > I'm having a great time coding this, I hope you all enjoy as much as I > do. > > Sorry for the long post. > -- > Christiano Farina HAESBAERT > Do NOT send me html mail.
