Apple Developer Connection
Advanced Search
Member Login Log In | Not a Member? Contact ADC


Version: 1.2

Posted: 2005-06-01

Build Requirements: Xcode 1.0 or later

Runtime Requirements: Mac OS X 10.3 or later

View Source Code:

Download Sample (“”, 18.0K)
Download Sample (“DNSServiceMetaQuery.dmg”, 76.0K)


This sample uses DNSServiceQueryRecord to send a Multicast DNS query that returns a list of Bonjour service types being advertised on the local network. Machines must be running mDNSResponder-58.6 (Mac OS X 10.3.4) or later in order to respond to this query.

Document Revision History

Date Notes
2005-06-01Added "#include <sys/socket.h>" to fix compiler errors in Mac OS X 10.4.
2004-12-09Added call to disable the CFSocket's kCFSocketCloseOnInvalidate option, since it's bad to close the DNSServiceRef's socket behind its back. Also removed inappropriate CFRelease of the CFSocket.
2004-05-29Shows how to discover Bonjour service types being advertised on the local network.

Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.