Swiftpack.co - madsolar8582/SLRDNSConfigurator as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
Library to configure secure DNS in macOS, iOS, tvOS, and watchOS
.package(url: "https://github.com/madsolar8582/SLRDNSConfigurator.git", from: "1.0.1")


Actions Status License: LGPL v3 Platforms: iOS | macOS | tvOS | watchOS

Provides convenience methods for configuring Network Privacy Contexts with secure DNS via DNS over HTTPS (DoH) or DNS over TLS (DoT).

Table of Contents

Getting Started

These instructions will get you up and running with SLRDNSConfigurator.



Version Minimum Xcode Version Minimum macOS SDK Minimum iOS SDK Minimum tvOS SDK Minimum watchOS SDK
1.0.0 -> Current 13.0 11.0 14.0 14.0 7.0

This library depends on a few system frameworks. If you have Modules and Link Frameworks Automatically enabled, then there isn't much that needs to be done. However, if you do not, you need to link against the Network, & Foundation frameworks.

Swift Package Installation

This is the recommended installation method. Follow the instructions provided by Apple using this repository's URL.

Binary Installation

You may download the latest binary from the releases page and then include it in your project.

Source Installation

If you want to build the library from source in your own project, you can either:

  1. Add the project as a submodule.
  2. Add the project as a subtree.
  3. Copy the source files directly into your project.

The submodule or subtree approaches are preferred over the copying of source files since you can easily obtain updates.


If you do not already have Carthage installed, you can install it via Homebrew:

brew install carthage

Once Carthage is installed, add SLRDNSConfigurator to your Cartfile:

github "madsolar8582/SLRDNSConfigurator" ~> 1.0.0

Finally, run carthage and take the resulting SLRDNSConfigurator.framework and put it in your project.


If you do not already have CocoaPods installed, you can install it via Homebrew or you can install it via gem:

brew install cocoapods

# OR

sudo gem install cocoapods # Note: sudo is required if you are installing to the system gemset

Once CocoaPods is installed, add SLRDNSConfigurator to your Podfile or to your Podspec as a dependency:

# Podfile
pod 'SLRDNSConfigurator', git: 'https://github.com/madsolar8582/SLRDNSConfigurator.git', tag: '1.0.0'

# Podspec
s.dependency 'SLRDNSConfigurator', git: 'https://github.com/madsolar8582/SLRDNSConfigurator.git', tag: '1.0.0'


To use this library, you just call the APIs provided on SLRDNSConfigurator. The default network privacy context is used by CFNetwork, Network.framework, and NSURLSession, which should cover all transactions within the application unless you use custom contexts. If so, there are APIs to modify those custom contexts.

Which method of secure DNS you want to use is up to you, however, keep in mind that if the network blocks the implementation you choose, DNS will stop working until you change methods or reset the network context to no longer use secure DNS.

@import SLRDNSConfigurator;

// DNS over HTTPS
[SLRDNSConfigurator configureDefaultNetworkContextWithDoHProvider:SLRDoHProviderCloudflare];

// DNS over TLS
[SLRDNSConfigurator configureDefaultNetworkContextWithDoTProvider:SLRDoTProviderCloudflare];

// Reset Network Context
[SLRDNSConfigurator resetDefaultNetworkContext];


Please read CONTRIBUTING for details on how to contribute.


Please read SUPPORT for details on how to get help with installation or usage.


This project is licensed under the LGPL v3 license.


Please read the CHANGELOG for details on the changes included in each release.


This project uses Semantic Versioning for versioning. For the versions available, see the releases page.

Release Management

This project releases monthly if there are enough changes to warrant a release. However, if there are critical defects or inadvertent non-passive changes, a one-off release will be created for each impacted release series.

After a major version release, the older release series will stop receiving updates after 60 days and are then considered obsolete (and thus unsupported).


Stars: 0
Last commit: 1 week ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Release Notes

SLRDNSConfigurator 1.0.1
1 week ago

SPM update only

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics