<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.8.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CFNetwork",
  "identifier" : "/documentation/CFNetwork/CFNetworkErrors/cfNetServiceErrorDNSServiceFailure",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "CFNetwork"
    ],
    "preciseIdentifier" : "c:@E@CFNetworkErrors@kCFNetServiceErrorDNSServiceFailure"
  },
  "title" : "CFNetworkErrors.cfNetServiceErrorDNSServiceFailure"
}
-->

# CFNetworkErrors.cfNetServiceErrorDNSServiceFailure

The DNS service discovery returned an error.

```
case cfNetServiceErrorDNSServiceFailure
```

## Discussion

Query the `kCFDNSServiceFailureKey` key to find out the error returned by DNS service discovery and look up the code in `/usr/include/dns_sd.h` or <doc://com.apple.documentation/documentation/dnssd/dns-service-discovery-c>.

---

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)