Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've seen the wonders of mDNS-based service discovery, but I haven't had much time to look more into it. I also there was references to it in DHCP config files or something.

How can I use mDNS to have zones auto-fill themselves?

  • Either by having DHCPd doing something

  • Or each machine advertising itself

I want queries to the local DNS server (internal use only) to be able to answer questions. How do I do that?

share|improve this question
up vote 2 down vote accepted

DNS Service Discovery is just a convention for finding services by first looking for a PTR record, eg:

$ dig +short ptr
;; Truncated, retrying in TCP mode.
<< snipped >>

Then an SRV record, eg:

$ dig +short srv \ *\ Multicast\
0 0 80

And finally a TXT record for anything not encapsulated by the SRV record:

$ dig +short txt \ *\ Multicast\

The end result of the above would be an entry titled " * Multicast DNS" that would link to You might ask how a DNS-SD aware client would know how to look up these records on Well it would either have to be explicitly told (configured manually) or it'd have to look at the systems search domains which could be configured via DHCP.

DHCP daemons can maintain records for the leases they give out by either being tightly coupled to a DNS daemon (eg: dnsmasq) or by sending update requests to a DNS server. Generally the later is done using TSIG'd DNS update requests but the method varies with DNS/DHCP servers used - this is pretty common with ISC BIND + DHCP and the Microsoft stack which uses a similar method.

Multicast DNS removes much of the hassle involved in setting up an environment like the above by making clients responsible for advertising their records. It's not without it's own quirks though - although it's got DNS in it's name, (unicast) DNS and mDNS don't interope, they exist in parallel which leads to clashes in environments that use the ".local" namespace (default for mDNS stacks) with their local unicast DNS. You can also end up with unexpected hostnames — if for example two clients vie for the same hostname, one will lose and retry with a number appended (this behaviour can be changed). That said, in a small environment this is not likely to become an issue.

mDNS setup is a matter of installing Bonjour on Windows or Avahi on UNIX like systems. OS X has Bonjour out of the box. Once installed, you should be able to access another machine via it's hostname with ".local" appended. Whilst it's possible to change from the default ".local" namespace it is a bit of a hassle.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.