About Bonjour
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; A
and 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.
Prerequisites
This document assumes that you are already familiar with the networking concepts described in Networking Overview and Networking Concepts.
See Also
DNS Service Discovery Programming Guide describes the Bonjour API appropriate for Darwin and Windows programmers and developers.
NSNetServices and CFNetServices Programming Guide describes the Bonjour API appropriate for Cocoa programmers and C and C++ programmers on OS X and iOS.
Copyright © 2013 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2013-04-23