DnsOverHttps 1.1.0
See the version list below for details.
dotnet add package DnsOverHttps --version 1.1.0
NuGet\Install-Package DnsOverHttps -Version 1.1.0
<PackageReference Include="DnsOverHttps" Version="1.1.0" />
paket add DnsOverHttps --version 1.1.0
#r "nuget: DnsOverHttps, 1.1.0"
// Install DnsOverHttps as a Cake Addin #addin nuget:?package=DnsOverHttps&version=1.1.0 // Install DnsOverHttps as a Cake Tool #tool nuget:?package=DnsOverHttps&version=1.1.0
DnsOverHttps
An async and lightweight C# library for Cloudflare's DNS over HTTPS.
Usage
Provides an easy interface for interacting with Cloudflare's DNS over HTTPS endpoints. Learn more about it here.
To get started, add the library into your solution with either the NuGet Package Manager
or the dotnet
CLI.
dotnet add package DnsOverHttps
For the primary class to become available, import the used namespace.
using DnsOverHttps;
Need more examples? Under the Example
directory you can find a working demo project that implements this library.
Features
- Built for .NET 6 and .NET 7
- Fully async
- Deep coverage of the API
- Extensive XML documentation
- No external dependencies (uses integrated HTTP and JSON)
- Custom exceptions (
DnsOverHttpsException
) for advanced catching - Example project to demonstrate all capabilities of the library
- Execute DNS queries over HTTPS of any type
Code Samples
Initializing a new API client
DnsOverHttpsClient dns = new();
Resolving A DNS records including DNSSEC
Response response = await dns.Resolve("discord.com", "A", true, true);
Using helper methods to return the first or all answers
Answer nsAnswer = await dns.GetFirst("example.com", "NS");
Answer[] aAnswers = await dns.GetAll("reddit.com", "A");
Available Methods
- Task<Response> Resolve(string name, ResourceRecordType type = ResourceRecordType.A, bool requestDnsSec = false, bool validateDnsSec = false)
- Task<Response[]> Resolve(string name, ResourceRecordType[] types, bool requestDnsSec = false, bool validateDnsSec = false)
- Task<Answer[]> ResolveAll(string name, ResourceRecordType type = ResourceRecordType.A, bool requestDnsSec = false, bool validateDnsSec = false)
- Task<Answer> ResolveFirst(string name, ResourceRecordType type = ResourceRecordType.A, bool requestDnsSec = false, bool validateDnsSec = false)
Resources
- Cloudflare: https://cloudflare.com
- 1.1.1.1: https://1.1.1.1
- Introduction: https://developers.cloudflare.com/1.1.1.1/encryption/dns-over-https
This is a community-ran library. Not affiliated with Cloudflare.
Icon made by Freepik at Flaticon.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.