<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkExtension",
  "identifier" : "/documentation/NetworkExtension/NEDNSProxyProvider",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Network Extension"
    ],
    "preciseIdentifier" : "c:objc(cs)NEDNSProxyProvider"
  },
  "title" : "NEDNSProxyProvider"
}
-->

# NEDNSProxyProvider

The principal class for a DNS proxy provider app extension.

```
class NEDNSProxyProvider
```

## Overview

A DNS proxy allows your app to intercept all DNS traffic generated on a device. You can use this capability to provide services like DNS traffic encryption, typically by redirecting DNS traffic to your own server. You usually do this in the context of managed devices, such as those owned by a school or an enterprise.

You create a DNS proxy as an app extension based on a custom subclass of the [`NEDNSProxyProvider`](/documentation/NetworkExtension/NEDNSProxyProvider) class. Once active, the proxy receives access to flows of DNS traffic in the form of [`NEAppProxyFlow`](/documentation/NetworkExtension/NEAppProxyFlow) instances. Each flow corresponds to a socket opened by an app to UDP port 53 or TCP port 53. Your DNS proxy provider acts as a transparent DNS proxy for the flows of network data that it receives.

> Important:
> To use the ``doc://com.apple.networkextension/documentation/NetworkExtension/NEDNSProxyProvider`` class, you must enable the Network Extensions capability in Xcode and select the DNS Proxy capability. See [Configure network extensions](http://help.apple.com/xcode/mac/current/#/dev0b2ef6f08).

When you subclass [`NEDNSProxyProvider`](/documentation/NetworkExtension/NEDNSProxyProvider), you must provide implementations for the following methods:

- [`startProxy(options:completionHandler:)`](/documentation/NetworkExtension/NEDNSProxyProvider/startProxy(options:completionHandler:))
- [`stopProxy(with:completionHandler:)`](/documentation/NetworkExtension/NEDNSProxyProvider/stopProxy(with:completionHandler:))
- [`handleNewFlow(_:)`](/documentation/NetworkExtension/NEDNSProxyProvider/handleNewFlow(_:))

## Topics

### Managing the DNS proxy life cycle

[`startProxy(options:completionHandler:)`](/documentation/NetworkExtension/NEDNSProxyProvider/startProxy(options:completionHandler:))

Starts the DNS proxy.

[`stopProxy(with:completionHandler:)`](/documentation/NetworkExtension/NEDNSProxyProvider/stopProxy(with:completionHandler:))

Stops the DNS proxy.

[`cancelProxyWithError(_:)`](/documentation/NetworkExtension/NEDNSProxyProvider/cancelProxyWithError(_:))

Cancels the DNS proxy.

### Handling proxied DNS flow

[`handleNewFlow(_:)`](/documentation/NetworkExtension/NEDNSProxyProvider/handleNewFlow(_:))

Handles a new flow of DNS traffic.

[`handleNewUDPFlow(_:initialRemoteEndpoint:)`](/documentation/NetworkExtension/NEDNSProxyProvider/handleNewUDPFlow(_:initialRemoteEndpoint:))

Handles a new flow of UDP traffic.

### Getting system DNS settings

[`systemDNSSettings`](/documentation/NetworkExtension/NEDNSProxyProvider/systemDNSSettings)

The current system DNS settings.



---

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)