<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "dnssd",
  "identifier" : "/documentation/dnssd/DNSServiceResolve(_:_:_:_:_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "dnssd"
    ],
    "preciseIdentifier" : "c:@F@DNSServiceResolve"
  },
  "title" : "DNSServiceResolve(_:_:_:_:_:_:_:_:)"
}
-->

# DNSServiceResolve(_:_:_:_:_:_:_:_:)

```
func DNSServiceResolve(_ sdRef: UnsafeMutablePointer<DNSServiceRef?>!, _ flags: DNSServiceFlags, _ interfaceIndex: UInt32, _ name: UnsafePointer<CChar>!, _ regtype: UnsafePointer<CChar>!, _ domain: UnsafePointer<CChar>!, _ callBack: DNSServiceResolveReply!, _ context: UnsafeMutableRawPointer!) -> DNSServiceErrorType
```

## Parameters

`sdRef`

A pointer to an uninitialized DNSServiceRef. If the call succeeds then it initializes the DNSServiceRef, returns [`kDNSServiceErr_NoError`](/documentation/dnssd/kDNSServiceErr_NoError), and the resolve operation will run indefinitely until the client terminates it by passing this DNSServiceRef to [`DNSServiceRefDeallocate(_:)`](/documentation/dnssd/DNSServiceRefDeallocate(_:)).

`flags`

Specifying kDNSServiceFlagsForceMulticast will cause query to be performed with a link-local mDNS query, even if the name is an apparently non-local name (i.e. a name not ending in “.local.”)

`interfaceIndex`

The interface on which to resolve the service. If this resolve call is as a result of a currently active [`DNSServiceBrowse(_:_:_:_:_:_:_:)`](/documentation/dnssd/DNSServiceBrowse(_:_:_:_:_:_:_:)) operation, then the interfaceIndex should be the index reported in the DNSServiceBrowseReply callback. If this resolve call is using information previously saved (e.g. in a preference file) for later use, then use interfaceIndex 0, because the desired service may now be reachable via a different physical interface. See “Constants for specifying an interface index” for more details.

`name`

The name of the service instance to be resolved, as reported to the [`DNSServiceBrowseReply`](/documentation/dnssd/DNSServiceBrowseReply) callback.

`regtype`

The type of the service instance to be resolved, as reported to the [`DNSServiceBrowseReply`](/documentation/dnssd/DNSServiceBrowseReply) callback.

`domain`

The domain of the service instance to be resolved, as reported to the [`DNSServiceBrowseReply`](/documentation/dnssd/DNSServiceBrowseReply) callback.

`callBack`

The function to be called when a result is found, or if the call asynchronously fails.

`context`

An application context pointer which is passed to the callback function (may be NULL).

## Return Value

Returns [`kDNSServiceErr_NoError`](/documentation/dnssd/kDNSServiceErr_NoError) 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).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)