In
computer network
A computer network is a set of computers sharing resources located on or provided by network nodes. The computers use common communication protocols over digital interconnections to communicate with each other. These interconnections are ...
ing, the multicast DNS (mDNS) protocol resolves
hostname
In computer networking, a hostname (archaically nodename) is a label that is assigned to a device connected to a computer network and that is used to identify the device in various forms of electronic communication, such as the World Wide Web. Hos ...
s to IP addresses within small networks that do not include a local
name server
A name server refers to the server component of the Domain Name System (DNS), one of the two principal namespaces of the Internet. The most important function of DNS servers is the translation (resolution) of human-memorable domain names (example. ...
. It is a
zero-configuration service, using essentially the same programming interfaces, packet formats and operating semantics as unicast
Domain Name Service
The Domain Name System (DNS) is a hierarchical and distributed naming system for computers, services, and other resources in the Internet or other Internet Protocol (IP) networks. It associates various information with domain names assigned t ...
(DNS). It was designed to work as either a stand-alone protocol or compatibly with standard DNS servers.
It uses IP multicast
User Datagram Protocol
In computer networking, the User Datagram Protocol (UDP) is one of the core communication protocols of the Internet protocol suite used to send messages (transported as datagrams in packets) to other hosts on an Internet Protocol (IP) network. ...
(UDP) packets, and is implemented by the Apple
Bonjour
Bonjour is a French word meaning (literally translated) "good day", and is commonly used as a greeting.
Bonjour may also refer to:
People
* Laurence BonJour (born 1943), epistemologist and professor of philosophy at the University of Washington
...
and open source
Avahi software packages, included in most Linux distributions. Although the
Windows 10
Windows 10 is a major release of Microsoft's Windows NT operating system. It is the direct successor to Windows 8.1, which was released nearly two years earlier. It was released to manufacturing on July 15, 2015, and later to retail on J ...
implementation was limited to discovering networked printers, subsequent releases resolved hostnames as well.
mDNS can work in conjunction with
DNS Service Discovery
Zero-configuration networking (zeroconf) is a set of technologies that automatically creates a usable computer network based on the Internet Protocol Suite (TCP/IP) when computers or network peripherals are interconnected. It does not require manu ...
(DNS-SD), a companion
zero-configuration networking
Zero-configuration networking (zeroconf) is a set of technologies that automatically creates a usable computer network based on the Internet Protocol Suite (TCP/IP) when computers or network peripherals are interconnected. It does not require manu ...
technique specified separately in RFC 6763.
History
Multicast DNS was first proposed by
Bill Woodcock
Bill Woodcock (born August 16, 1971 in San Francisco, California, United States) is the executive director of Packet Clearing House, the international organization responsible for providing operational support and security to critical Internet ...
and Bill Manning in the
IETF
The Internet Engineering Task Force (IETF) is a standards organization for the Internet and is responsible for the technical standards that make up the Internet protocol suite (TCP/IP). It has no formal membership roster or requirements and a ...
in 2000, and was eventually published as standards-track IETF RFC 6762 by
Stuart Cheshire
Stuart Cheshire is a Distinguished Engineer, Scientist and Technologist (DEST) at Apple. He pioneered Zeroconf networking while employed at Apple. Zeroconf was originally released by Apple as Rendezvous, but later renamed Bonjour. Subsequently, he ...
and Marc Krochmal thirteen years later.
Protocol overview
When an mDNS client needs to resolve a hostname, it sends an
IP multicast
IP multicast is a method of sending Internet Protocol (IP) datagrams to a group of interested receivers in a single transmission. It is the IP-specific form of multicast and is used for streaming media and other network applications. It uses speci ...
query message that asks the host having that name to identify itself. That target machine then multicasts a message that includes its IP address. All machines in that subnet can then use that information to update their mDNS caches. Any host can relinquish its claim to a name by sending a response packet with a
time to live
Time to live (TTL) or hop limit is a mechanism which limits the lifespan or lifetime of data in a computer or network. TTL may be implemented as a counter or timestamp attached to or embedded in the data. Once the prescribed event count or timesp ...
(TTL) equal to zero.
By default, mDNS exclusively resolves hostnames ending with the
.local
The domain name .local is a special-use domain name reserved by the Internet Engineering Task Force (IETF) so that it may not be installed as a top-level domain in the Domain Name System (DNS) of the Internet. As such it is similar to the other ...
top-level domain. This can cause problems if .local includes hosts that do not implement mDNS but that can be found via a conventional unicast DNS server. Resolving such conflicts requires network-configuration changes that mDNS was designed to avoid.
Packet structure
An mDNS message is a multicast UDP packet sent using the following addressing:
*
IPv4 address
Internet Protocol version 4 (IPv4) is the fourth version of the Internet Protocol (IP). It is one of the core protocols of standards-based internetworking methods in the Internet and other packet-switched networks. IPv4 was the first version d ...
or
IPv6 address
An Internet Protocol Version 6 address (IPv6 address) is a numeric label that is used to identify and locate a network interface of a computer or a network node participating in a computer network using IPv6. IP addresses are included in the pac ...
*
UDP port
This is a list of TCP and UDP port numbers used by protocols for operation of network applications.
The Transmission Control Protocol (TCP) and the User Datagram Protocol (UDP) only need one port for duplex, bidirectional traffic. They usually u ...
5353
* When using
Ethernet frame
In computer networking, an Ethernet frame is a data link layer protocol data unit and uses the underlying Ethernet physical layer transport mechanisms. In other words, a data unit on an Ethernet link transports an Ethernet frame as its payload.
...
s, the
standard IP multicast MAC address (for
IPv4
Internet Protocol version 4 (IPv4) is the fourth version of the Internet Protocol (IP). It is one of the core protocols of standards-based internetworking methods in the Internet and other packet-switched networks. IPv4 was the first version de ...
) or (for
IPv6
Internet Protocol version 6 (IPv6) is the most recent version of the Internet Protocol (IP), the communication protocol, communications protocol that provides an identification and location system for computers on networks and routes traffic ...
)
The payload structure is based on the
unicast DNS packet format, consisting of two parts—the header and the data.
[.]
The header is identical to that found in unicast DNS, as are the sub-sections in the data part: queries, answers, authoritative-nameservers, and additional records. The number of records in each sub-section matches the value of the corresponding *COUNT field in the header.
Queries
The wire format for records in the query section is slightly modified from that in unicast DNS, adding the single-bit UNICAST-RESPONSE field.
As in unicast DNS, the QNAME field consists of a series of length/value sub-fields called "labels". Each label represents one of the dot-separated substrings in a
fully qualified domain name
A fully qualified domain name (FQDN), sometimes also referred to as an ''absolute domain name'', is a domain name that specifies its exact location in the tree hierarchy of the Domain Name System (DNS). It specifies all domain levels, including th ...
(FQDN). The list is terminated by either a single null-byte representing the "root" of the DNS, or by a byte with the two high-order bits set (value 192) to signal an indirect pointer to another location in the message. This is known as name compression in RFC-6762.
The UNICAST-RESPONSE field is used to minimize unnecessary broadcasts on the network: if the bit is set, responders SHOULD send a directed-unicast response directly to the inquiring node rather than broadcasting the response to the entire network.
The QCLASS field is identical to that found in unicast DNS.
Resource Records
All records in the answers, authoritative-nameservers, and additional records sections have the same format and are collectively known as Resource Records (RR).
Resource Records in mDNS also have a slightly modified general format compared to unicast DNS:
The CACHE-FLUSH bit is used to instruct neighbor nodes that the record should overwrite, rather than be appended onto, any existing cached entries for this RRNAME and RRTYPE.
The formats of the RDATA fields are the same as those found in unicast DNS. However,
DNS Service Discovery
Zero-configuration networking (zeroconf) is a set of technologies that automatically creates a usable computer network based on the Internet Protocol Suite (TCP/IP) when computers or network peripherals are interconnected. It does not require manu ...
(DNS-SD), the most common use-case for mDNS, specifies slight modifications to some of their formats (notably TXT records).
See also
*
Bonjour Sleep Proxy
Apple's Bonjour Sleep Proxy service is an open source component of zero-configuration networking, designed to assist in reducing power consumption of networked electronic devices.
A device acting as a sleep proxy server will respond to Multica ...
*
Link-Local Multicast Name Resolution (LLMNR)
*
Name Service Switch
The Name Service Switch (NSS) connects the computer with a variety of sources of common configuration databases and name resolution mechanisms. These sources include local operating system files (such as , , and ), the Domain Name System (DNS), th ...
(NSS)
References
{{Reflist
External links
Multicast DNS- information site maintained by mDNS designer, Stuart Cheshire
LLMNR, Multicast DNS and names on your LAN
Domain Name System
Application layer protocols