DNS Service Discovery allows machines running appropriate software to automatically configure themselves with information about local network services. This is done based on search domains applied using DHCP configuration. E.g. our network is configured to give machines the search domain of entropy.me.uk, machines running Service Discovery software (e.g. Apple’s Bonjour, or Avahi) will query special DNS records on entropy.me.uk for information about available services.
The DNS records in question are:
b._dns-sd._udp PTR @
lb._dns-sd._udp PTR @
(The @ symbol is substituted for the current domain, in this case entropy.me.uk.)
These are for “browse” and “legacy browse”, records can also be added to tell clients to set this domain as their default as well as to activate dynamic DNS updating for this zone. See http://www.dns-sd.org/ServerSetup.html for more.
These records tell querying machines that entropy.me.uk has available services. The querying machine will next check for records like this one:
_services._dns-sd._udp PTR _afpovertcp._tcp
There can be many of these, each with a different pointer, so you can have AFP shares, printers, web pages etc. etc. available on your domain as services. The “_services._dns-sd._udp” entries act as a kind of directory to allow machines to look up a directory of services.
These PTR records are just pointers, there is one more in the chain:
_afpovertcp._tcp PTR singularity._afpovertcp._tcp
Again, this is a directory, there could be multiple _afpovertcp._tcp entries to refer to multiple AFP shares available on the domain.
The last entry in the chain is:
singularity._afpovertcp._tcp SRV 0 0 548 singularity.entropy.me.uk.
This is a SRV record, letting the requesting client know where it can find a service hosted on this domain. In this case the endpoint is our file server, singularity. The SRV record indicates that port 548 should be used. A standard A or AAAA lookup gives the IPv4 or IPv6 address of the server to use for communication.
The upshot of all of this is that when a computer running Service Discovery connects to our network and gets the entropy.me.uk search domain it can automatically discover a directory of services offered on that domain. This includes a list of AFP servers, one of which, singularity, is offered via a SRV record.
Further power is afforded to DNS-SD through the use of dnsextd, this implements the idea of DNS leases which can be used by dynamic DNS clients to notify in near-realtime that they are available (and to notice when they aren’t anymore). This allows servers to advertise their availability to clients. This has dynamic DNS as a prerequisite, and there are security implications to that. I haven’t yet implemented this for our network.
There is one slight downside to advertising AFP shares this way, on Mac OSX in Finder (at least in 10.6) a list of available shares is shown under the “Shared” item in the left-pane. This shows local shares (found using multicast DNS, or “local” Bonjour) directly by name (e.g. it shows Photon, our Mac Mini). Servers discovered via a search domain and DNS-SD appear under a single “All…” item, which you have to click through to get to the lower levels. This isn’t the end of the world of course, but it doesn’t quite have the same simple “one-click” appeal that mDNS seems to.
Further work needed on this of course, to add all the other domain services to DNS.