The Bonjour zero-configuration networking architecture provides support for publishing and discovering TCP/IP-based services on a local area or wide area network. This document describes the Bonjour architecture at a high level and briefly describes what Bonjour APIs are available.
At a Glance
Bonjour is Apple’s implementation of a suite of zero-configuration networking protocols. Bonjour is designed to make network configuration easier for users.
For example, Bonjour lets you connect a printer to your network without the need to assign it a specific IP address or manually enter that address into each computer. With zero-configuration networking, nearby computers can discover its existence and automatically determine the printer’s IP address. And if that address is a dynamically assigned address that changes, they can automatically discover the new address in the future.
Apps can also leverage Bonjour to automatically detect other instances of the app (or other services) on the network. For example, two users running an iOS photo sharing app could share photos over a Bluetooth personal area network without the need to manually configure IP addresses on either device.
Bonjour Provides Efficient Service Discovery
The Bonjour protocol supports advertising and discovering services in a manner that is efficient and robust using multicast DNS (mDNS) and, when needed, link-local addressing.
Bonjour Reserves the .local Domain for mDNS-Advertised Services
Bonjour host names and service names are constructed using a specific set of rules.
Bonjour Uses SRV, TXT, and PTR Records to Look Up Services
Bonjour uses service-specific records to advertise the existence of services.
PTR records let you discover all of the services in a domain;
SRV records translate a service instance name, type, and domain into a hostname and port;
AAAA records translate a host name into an IP address, and
TXT records provide additional information about a service.
Bonjour Provides APIs at Multiple Layers in OS X and iOS
In OS X and iOS, Bonjour provides the ability to advertise and discover services using Foundation, Core Foundation, and C APIs. In OS X, Bonjour also provides a Java API. On other platforms such as Windows and Linux, Bonjour provides a C API.
This document assumes that you are already familiar with the networking concepts described in Networking Overview and Networking Concepts.