<!--
{
  "documentType" : "article",
  "framework" : "dnssd",
  "identifier" : "/documentation/dnssd/DNSServiceCreateDelegateConnection",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "DNSServiceCreateDelegateConnection"
}
-->

# DNSServiceCreateDelegateConnection

Create a delegate connection to the daemon allowing efficient registration of multiple individual records.

## Discussion

```objc
DNSServiceErrorType DNSServiceCreateDelegateConnection (
   DNSServiceRef *sdRef,
   int32_t pid,
   uuid_t uuid
);
```

## Parameters

**sdRef**

A pointer to an uninitialized DNSServiceRef. Deallocating the reference (via DNSServiceRefDeallocate()) severs the connection and deregisters all records registered on this connection.

**pid**

Process ID of the delegate

**uuid**

UUID of the delegate

Note that only one of the two arguments (pid or uuid) can be specified. If pid is zero, uuid will be assumed to be a valid value; otherwise pid will be used.

## Return Value

Returns kDNSServiceErr_NoError on success, otherwise returns an error code indicating the specific failure that occurred (in which case the DNSServiceRef is not initialized). kDNSServiceErr_NotAuth is returned to indicate that the calling process does not have entitlements to use this API.

---

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)