Hello Jan, jan damborsky wrote: > Hi Rishi, > > couple of month ago, we were discussing if we might take advantage of > service discovery in Automated Installer (AI) project [1]. > Maybe you remember :-)
Yes I remember the discussions. > We have implemented the first phase which uses service discovery over > multicast DNS and now we are in process of enhancing the prototype with > support for service discovery over unicast DNS. > > At the time being, we use dns-sd(1M) utility for multicast DNS: > * On AI server side, it is used for registering/advertising the service > * On AI client side, it is used for looking up the service > > It is sufficient for proof of concept, but since dns-sd(1M) is only > recommended to be used as testing/debugging tool, as a long term solution, > we would like to create dedicated daemon directly consuming libdns_sd(3LIB) > library taking care of all service discovery tasks. Great to hear. > Meanwhile, we are thinking about how we might implement support for unicast > DNS for now. As far as server side is concerned, we will ask user to > manually > add appropriate PTR and SRV records to the DNS server database. Later > we might be thinking about dynamic DNS update. > > With respect to client side, we are thinking if we can continue to use > dns-sd(1M) for looking up the service over unicast DNS. > > I have gone through your presentation about Service Discovery and > multicast DNS [2] and in examples, dns-sd(1M) is only used > for testing multicast DNS, dig(1M) and nslookup(1M) are utilized > for testing unicast DNS part. > > Since dns-sd(1M) takes domain to browse as parameter, I was wondering > if we could do something like following to look up '_test_service' > instance of '_OSInstall._tcp' service in 'ai-caiman.org' domain. > > $ dns-sd -L _test_service _OSInstall._tcp ai-caiman.org > > I have tried, but snoop(1M) didn't report any traffic on net > which might be related to this. Yes, that should work. I ran a quick test and could see unicast DNS packets from dns-sd for the following query: $ dns-sd -B _test._tcp test.com Browsing for _test._tcp.test.com $ pfexec snoop -d nge0 port 53 Using device nge0 (promiscuous mode) 10.48.8.35 -> wrt54gtm DNS C _test._tcp.test.com. Internet PTR ? wrt54gtm -> 10.48.8.35 DNS R > I was able to successfully query appropriate PTR and SRV records > using dig(1M) or nslookup(1M) commands. I have added following > records to DNS database for created 'ai-caiman.org' domain: [....] > I have couple of questions here in order to clarify what approach > we might take. Could I please ask you if you might help us understand > what the limitations are and what approach we might take ? > > * Can we use dns-sd(1M) for browsing domains/looking up services which > are available over unicast DNS ? If we can, what are the prerequisites > we need to meet in order to make it work ? Yes, unicast DNS PTR and SRV record queries should work with dns-sd as well. Can you make sure you have /etc/resolv.conf point to your test server and try repeating the tests? > * If dns-sd(1M) can't be used, could we take advantage of dig(1M) or > nslookup(1M) commands instead ? Yes, you could try to do the same by using libresolv but libdns_sd has a much simpler API. > * As far as long term solution is concerned, does libdns_sd(3LIB) support > unicast DNS ? What kind of operations are supported (look up, register, > ...) ? It should support the basic query operations over unicast DNS already. Future versions should have better support for dynamic DNS updates. Rishi
