---
title: DNSServiceRegisterReply
framework: dnssd
role: symbol
role_heading: Type Alias
path: dnssd/dnsserviceregisterreply
---

# DNSServiceRegisterReply

Handler for the results from a previous call to DNSServiceRegister(_:_:_:_:_:_:_:_:_:_:_:_:).

## Declaration

```swift
typealias DNSServiceRegisterReply = (DNSServiceRef?, DNSServiceFlags, DNSServiceErrorType, UnsafePointer<CChar>?, UnsafePointer<CChar>?, UnsafePointer<CChar>?, UnsafeMutableRawPointer?) -> Void
```

## Parameters

- `sdRef`: The DNSServiceRef initialized by doc://com.apple.dnssd/documentation/dnssd/DNSServiceRegister(_:_:_:_:_:_:_:_:_:_:_:_:).
- `flags`: When a name is successfully registered, the callback will be invoked with the kDNSServiceFlagsAdd flag set. When Wide-Area DNS-SD is in use, it is possible for a single service to get more than one success callback (e.g. one in the “local” multicast DNS domain, and another in a wide-area unicast DNS domain). If a successfully-registered name later suffers a name conflict or similar problem and has to be deregistered, the callback will be invoked with the kDNSServiceFlagsAdd flag not set. The callback is *not* invoked in the case where the caller explicitly terminates the service registration by calling DNSServiceRefDeallocate(ref);
- `errorCode`: Will be doc://com.apple.dnssd/documentation/dnssd/kDNSServiceErr_NoError on success, otherwise will indicate the failure that occurred (including name conflicts, if the kDNSServiceFlagsNoAutoRename flag was used when registering.) Other parameters are undefined if errorCode is nonzero.
- `name`: The service name registered (if the application did not specify a name in doc://com.apple.dnssd/documentation/dnssd/DNSServiceRegister(_:_:_:_:_:_:_:_:_:_:_:_:), this indicates what name was automatically chosen).
- `regtype`: The type of service registered, as it was passed to the callout.
- `domain`: The domain on which the service was registered (if the application did not specify a domain in doc://com.apple.dnssd/documentation/dnssd/DNSServiceRegister(_:_:_:_:_:_:_:_:_:_:_:_:), this indicates the default domain on which the service was registered).
- `context`: The context pointer that was passed to the callout.

## See Also

### Callbacks

- [DNSServiceGetAddrInfoReply](dnssd/dnsservicegetaddrinforeply.md)
- [DNSServiceRegisterRecordReply](dnssd/dnsserviceregisterrecordreply.md)
- [DNSServiceBrowseReply](dnssd/dnsservicebrowsereply.md)
- [DNSServiceResolveReply](dnssd/dnsserviceresolvereply.md)
- [DNSServiceQueryRecordReply](dnssd/dnsservicequeryrecordreply.md)
- [DNSServiceNATPortMappingReply](dnssd/dnsservicenatportmappingreply.md)
- [DNSServiceDomainEnumReply](dnssd/dnsservicedomainenumreply.md)
