DoHoN 0.1.1
dotnet add package DoHoN --version 0.1.1
NuGet\Install-Package DoHoN -Version 0.1.1
<PackageReference Include="DoHoN" Version="0.1.1" />
paket add DoHoN --version 0.1.1
#r "nuget: DoHoN, 0.1.1"
// Install DoHoN as a Cake Addin #addin nuget:?package=DoHoN&version=0.1.1 // Install DoHoN as a Cake Tool #tool nuget:?package=DoHoN&version=0.1.1
DNS over HTTPS on .NET
DoHoN (stylised ドホン) is a DNS over HTTPS client for .NET. It's simple, clean, fast, and supports both synchronous and asynchronous usage with caching (and respects TTLs!). It uses .NET Core 2.0 to provide cross-compatibility across multiple OSes. It uses the application/dns-json
format.
Currently it allows the use of any DNS services, but defaults to trying Cloudflare (1.1.1.1) then Google (8.8.8.8). It has secure defaults, requiring DNSSEC verified responses and using consistent padded lengths to minimise snooping. It also requests services do not attempt to geolocate you by default, although you can flip the RequestNoGeolocation
field to change this.
Usage
Usage is simple:
using (var client = new DoHClient())
{
//Get example.com IPv4 record
String ipv4 = client.LookupSync("example.com", ResourceRecordType.A).First().Data;
...
}
It throws DNSLookupException
exceptions for common errors (like not being able to find a viable DNS server, or an invalid lookup).
You can set your own DNS over HTTPS servers like so:
client.SetEndpoints(new[] {"https://example.com/resolve", "https://2.example.com/resolve"});
Licensing
The source code is made available under the GNU Affero General Public License v3.0. It's like the GPL, except if you modify the source code and use that modified code on your server you need to make your derivative source code available to anyone using your network server. If your server is public, you need to make the derived code public. If you use the library without modification, you don't need to do anything. You are not contractual bound to release any source code that uses this code merely as a library. Consider this a linking exception if you prefer to think of it that way; nobody is going to snarf your source code, just make sure you give back any improvements to DoHoN back to the community.
Bugs? Requests?
Drop an issue and I'll take a look when I have time.
Why make this?
I was bored one evening and wanted to try out a new protocol. That's it, really. Enjoy!
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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 was computed. 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. |
.NET Core | netcoreapp2.0 is compatible. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
-
.NETCoreApp 2.0
- Newtonsoft.Json (>= 11.0.2)
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.1.1 | 13 | 4/5/2018 |
Initial release