<!--
{
  "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/NEDNSProxyManager/loadFromPreferences(completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Network Extension"
    ],
    "preciseIdentifier" : "c:objc(cs)NEDNSProxyManager(im)loadFromPreferencesWithCompletionHandler:"
  },
  "title" : "loadFromPreferences(completionHandler:)"
}
-->

# loadFromPreferences(completionHandler:)

Loads the current DNS proxy configuration from the caller’s DNS proxy preferences.

```
func loadFromPreferences(completionHandler: @escaping @Sendable ((any Error)?) -> Void)
```

## Parameters

`completionHandler`

A block called when the load operation completes. If the operation fails, an error instance passed to this block describes the problem. Otherwise, the error is `nil`. See [`NEDNSProxyManagerError`](/documentation/NetworkExtension/NEDNSProxyManagerError) for the list of possible errors.

## Discussion

Initially, the DNS proxy configuration comes from a configuration profile stored on the device in a managed environment, as described in [Configuration Profile Reference](https://developer.apple.com/library/archive/featuredarticles/iPhoneConfigurationProfileRef/Introduction/Introduction.html#//apple_ref/doc/uid/TP40010206).

When you want to inspect or make changes to the configuration, you call the proxy manager’s [`loadFromPreferences(completionHandler:)`](/documentation/NetworkExtension/NEDNSProxyManager/loadFromPreferences(completionHandler:)) method. This causes the system to load the configuration into the manager’s [`providerProtocol`](/documentation/NetworkExtension/NEDNSProxyManager/providerProtocol) and [`isEnabled`](/documentation/NetworkExtension/NEDNSProxyManager/isEnabled) properties.

If you modify the configuration stored in these properties, you must then call the [`saveToPreferences(completionHandler:)`](/documentation/NetworkExtension/NEDNSProxyManager/saveToPreferences(completionHandler:)) method to make the changes take effect. Saving the preferences also stores the modified configuration on disk for use the next time the proxy is started or the configuration is loaded.

---

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)