---
title: "DNSServiceConstructFullName(_:_:_:_:)"
framework: dnssd
role: symbol
role_heading: Function
path: "dnssd/dnsserviceconstructfullname(_:_:_:_:)"
---

# DNSServiceConstructFullName(_:_:_:_:)

Concatenates a three-part domain name (as returned by the above callbacks) into a properly-escaped full domain name.

## Declaration

```swift
func DNSServiceConstructFullName(_ fullName: UnsafeMutablePointer<CChar>!, _ service: UnsafePointer<CChar>!, _ regtype: UnsafePointer<CChar>!, _ domain: UnsafePointer<CChar>!) -> DNSServiceErrorType
```

## Parameters

- `fullName`: A pointer to a buffer that where the resulting full domain name is to be written. The buffer must be doc://com.apple.dnssd/documentation/dnssd/kDNSServiceMaxDomainName (1009) bytes in length to accommodate the longest legal domain name without buffer overrun.
- `service`: The service name - any dots or backslashes must NOT be escaped. May be NULL (to construct a PTR record name, e.g. “_ftp._tcp.apple.com.”).
- `regtype`: The service type followed by the protocol, separated by a dot (e.g. “_ftp._tcp”).
- `domain`: The domain name, e.g. “apple.com.”. Literal dots or backslashes, if any, must be escaped, e.g. “1st. Floor.apple.com.”

## Return Value

Return Value Returns kDNSServiceErr_NoError (0) on success, kDNSServiceErr_BadParam on error.

## Discussion

Discussion Note that callbacks in the above functions ALREADY ESCAPE strings where necessary.
