Query for an arbitrary DNS record.
- iOS 9.3+
- macOS 10.11.4+
- Mac Catalyst 13.0+Beta
- tvOS 9.2+
- watchOS 2.2+
kDNSServiceFlagsForceMulticast or kDNSServiceFlagsLongLivedQuery. Pass kDNSServiceFlagsLongLivedQuery to create a "long-lived" unicast query to a unicast DNS server that implements the protocol. This flag has no effect on link-local multicast queries.
If non-zero, specifies the interface on which to issue the query (the index for a given interface is determined via the if_nametoindex() family of calls.) Passing 0 causes the name to be queried for on all interfaces. See "Constants for specifying an interface index" for more details.
The full domain name of the resource record to be queried for.
The numerical type of the resource record to be queried for (e.g. kDNSServiceType_PTR, kDNSServiceType_SRV, and so on).
The class of the resource record (usually
DNSService Class _IN
The function to be called when a result is found, or if the call asynchronously fails.
An application context pointer which is passed to the callback function (may be NULL).
k on success (any subsequent, asynchronous errors are delivered to the callback), otherwise returns an error code indicating the error that occurred (the callback is never invoked and the DNSServiceRef is not initialized).