<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkExtension",
  "identifier" : "/documentation/NetworkExtension/NEDNSSettingsManager/removeFromPreferences(completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Network Extension"
    ],
    "preciseIdentifier" : "c:objc(cs)NEDNSSettingsManager(im)removeFromPreferencesWithCompletionHandler:"
  },
  "title" : "removeFromPreferences(completionHandler:)"
}
-->

# removeFromPreferences(completionHandler:)

Remove your DNS settings configuration from the system networking preferences.

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

## Parameters

`completionHandler`

An optional block that takes an <doc://com.apple.documentation/documentation/Foundation/NSError> object. If specified, this block runs on your application’s main thread after your configuration is removed. If an error occurs while removing the configuration, the block returns an `NSError` object.

## Discussion

After you remove your configuration, the `NEDNSSettingsManager` object still contains the configuration parameters. Calling [`loadFromPreferences(completionHandler:)`](/documentation/NetworkExtension/NEDNSSettingsManager/loadFromPreferences(completionHandler:)) clears out the configuration parameters from the `NEDNSSettingsManager` object.

---

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)