|
Q: Is it possible to dynamically discover every Bonjour service type being advertised on the network?A: Yes. Devices running mDNSResponder-58.6 (Mac OS X 10.3.4) or later will respond to the "Service Type Enumeration" meta-query described in Section 10 of the DNS-SD specification. Issuing a Multicast DNS PTR record query for the name "_services._dns-sd._udp.local." will return a list of service types being advertised on the local network. Queries for "_services._dns-sd._udp.local." behave somewhat differently than standard mDNS queries. Normal mDNS long-lived queries will return ADD/REMOVE events as records are registered and deregistered, however, a service type enumeration meta-query will not be told about REMOVE events when a service is deregistered. Otherwise, the meta-query behaves identically to a standard mDNS query. It will receive REMOVE events when a network interface is disabled or if the PTR record expires from the cache naturally. Note: This non-standard behavior helps to reduce network traffic. Since multiple devices on the network will typically register the exact same meta-query PTR record, if one of the devices were to send a goodbye packet for that record, then at least one other device would be required to respond in order to "rescue" the record from being deleted. It's for that reason that goodbye packets are not sent for meta-query PTR records. For more information about goodbye packets, please see Section 13.2 of the Multicast DNS specification. You can issue this meta-query by using The DNSServiceMetaQuery sample code shows how to issue the service type enumeration meta-query. Document Revision History
Posted: 2004-06-01 |
|