DnsOverHttps 1.2.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package DnsOverHttps --version 1.2.1                
NuGet\Install-Package DnsOverHttps -Version 1.2.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DnsOverHttps" Version="1.2.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DnsOverHttps --version 1.2.1                
#r "nuget: DnsOverHttps, 1.2.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DnsOverHttps as a Cake Addin
#addin nuget:?package=DnsOverHttps&version=1.2.1

// Install DnsOverHttps as a Cake Tool
#tool nuget:?package=DnsOverHttps&version=1.2.1                

DnsOverHttps

alternate text is missing from this package README image

An async and lightweight C# library for Cloudflare's DNS over HTTPS.

Usage

This library provides an easy interface for interacting with Cloudflare's DNS over HTTPS endpoints.

DoH is a protocol that enhances the privacy and security of DNS queries by encrypting them using HTTPS. This helps prevent unauthorized access or tampering of DNS data during transmission. Learn more about it here.

To get started, import 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.

Properties

  • Built for .NET 8, .NET 7 and .NET 6
  • Fully async
  • Extensive XML documentation
  • No external dependencies (makes use of built-in HttpClient and JsonSerializer)
  • Custom exceptions (DnsOverHttpsException) for easy debugging
  • Example project to demonstrate all capabilities of the library

Features

  • Resolve one or all DNS records under a hostname
  • Ask for DNSSEC validation
  • Query in parallel
  • Specify advanced parameters

Code Samples

Initializing a new API client

DnsOverHttpsClient dns = new();

Resolving A DNS records including DNSSEC

Response response = await dns.Resolve("discord.com", ResourceRecordType.A, true, true);

Using helper methods to return the first or all answers

Answer? nsAnswer = await dns.ResolveFirst("example.com", ResourceRecordType.NS);
Answer[] aAnswers = await dns.ResolveAll("reddit.com", ResourceRecordType.A);

Resources

This is a community-ran library. Not affiliated with Cloudflare, Inc.

Icon made by Freepik at Flaticon.

Product 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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.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.

Version Downloads Last updated
1.2.2 4,592 3/2/2024
1.2.1 2,286 11/25/2023
1.2.0 137 11/25/2023
1.1.1 808 11/25/2022
1.1.0 332 11/20/2022
1.0.0 342 11/19/2022