---
title: "loadFromPreferences(completionHandler:)"
framework: networkextension
role: symbol
role_heading: Instance Method
path: "networkextension/nednssettingsmanager/loadfrompreferences(completionhandler:)"
---

# loadFromPreferences(completionHandler:)

Load your DNS settings configuration from the system networking preferences.

## Declaration

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

```swift
func loadFromPreferences() async throws
```

## Parameters

- `completionHandler`: A block that takes an doc://com.apple.documentation/documentation/Foundation/NSError object. This block runs on your application’s main thread after the load operation is complete. If an error occurs while loading the configuration, the block returns an NSError object.

## Discussion

Discussion You must call this method at least once before calling saveToPreferences(completionHandler:) for the first time after your app launches.

## See Also

### Managing DNS configurations

- [shared()](networkextension/nednssettingsmanager/shared().md)
- [saveToPreferences(completionHandler:)](networkextension/nednssettingsmanager/savetopreferences(completionhandler:).md)
- [removeFromPreferences(completionHandler:)](networkextension/nednssettingsmanager/removefrompreferences(completionhandler:).md)
