-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
78 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,93 @@ | ||
<div align="center"> | ||
<div align="center"> | ||
|
||
![Icon](images/icon.png) | ||
# Dino DNS | ||
A fast and efficient DNS server and client | ||
|
||
![Build](https://img.shields.io/github/workflow/status/TurnerSoftware/DinoDNS/Build) | ||
<!--[![NuGet](https://img.shields.io/nuget/v/TurnerSoftware.DinoDNS.svg)](https://www.nuget.org/packages/TurnerSoftware.DinoDNS/)--> | ||
[![NuGet](https://img.shields.io/nuget/v/TurnerSoftware.DinoDNS.svg)](https://www.nuget.org/packages/TurnerSoftware.DinoDNS/) | ||
</div> | ||
|
||
## Overview | ||
|
||
Dino DNS provides fast and flexible DNS client and server implementations for: | ||
|
||
- DNS-over-UDP | ||
- DNS-over-TCP | ||
- [DNS-over-TLS](https://en.wikipedia.org/wiki/DNS-over-TLS) | ||
- [DNS-over-HTTPS](https://en.wikipedia.org/wiki/DNS-over-HTTPS) | ||
|
||
## 🤝 Licensing and Support | ||
|
||
## Under Development | ||
Dino DNS is licensed under the MIT license. It is free to use in personal and commercial projects. | ||
|
||
Currently under development. | ||
There are [support plans](https://turnersoftware.com.au/support-plans) available that cover all active [Turner Software OSS projects](https://github.com/TurnerSoftware). | ||
Support plans provide private email support, expert usage advice for our projects, priority bug fixes and more. | ||
These support plans help fund our OSS commitments to provide better software for everyone. | ||
|
||
## See Also | ||
## 🥇 Performance | ||
|
||
- [RFC 1035 - Domain Names](https://datatracker.ietf.org/doc/html/rfc1035) | ||
- [RFC 2136 - Dynamic Updates in the Domain Name System](https://datatracker.ietf.org/doc/html/rfc2136) | ||
These performance comparisons show the performance overhead of the DNS library itself and associated allocations. | ||
They do not represent the overhead to remote DNS servers. | ||
|
||
The server implementation that each benchmark is performing against is Dino DNS. | ||
|
||
### DNS-over-UDP | ||
|
||
This is your typical DNS query. | ||
While fast and efficient, it is limited by the lack of transport-layer encryption, reliable delivery and message length. | ||
|
||
| Method | Mean | Error | StdDev | Op/s | Ratio | RatioSD | Gen 0 | Allocated | | ||
|------------------ |----------:|----------:|----------:|---------:|------:|--------:|--------:|----------:| | ||
| DinoDNS | 97.89 us | 1.930 us | 3.577 us | 10,215.4 | 1.00 | 0.00 | 0.8545 | 2,864 B | | ||
| Kapetan_DNS | 347.28 us | 10.655 us | 31.418 us | 2,879.5 | 3.60 | 0.46 | 23.9258 | 75,150 B | | ||
| MichaCo_DnsClient | 114.71 us | 1.897 us | 1.774 us | 8,717.5 | 1.18 | 0.05 | 1.4648 | 4,663 B | | ||
|
||
### DNS-over-TCP | ||
|
||
With TCP DNS queries, there is a small overhead from negotiating the connection but otherwise is very fast. | ||
It addresses the reliable delivery and message length limitations that occur with UDP queries. | ||
|
||
A good DNS client implementation will pool TCP sockets to avoid needing to negotiate the connection per request. | ||
|
||
| Method | Mean | Error | StdDev | Op/s | Ratio | RatioSD | Gen 0 | Allocated | | ||
|------------------ |----------:|---------:|---------:|---------:|------:|--------:|-------:|----------:| | ||
| DinoDNS | 93.58 us | 1.793 us | 1.678 us | 10,685.9 | 1.00 | 0.00 | 0.4883 | 1,900 B | | ||
| MichaCo_DnsClient | 114.45 us | 2.215 us | 2.551 us | 8,737.3 | 1.23 | 0.03 | 1.4648 | 5,067 B | | ||
|
||
<small> | ||
⚠ Note: While Kapetan's DNS client does support TCP, it can't be benchmarked due to port exhaustion issues it has. | ||
</small> | ||
|
||
### DNS-over-TLS | ||
|
||
With DNS-over-TLS, you get the benefits of DNS-over-TCP with transport-layer encryption between the client and the server. | ||
|
||
| Method | Mean | Error | StdDev | Op/s | Ratio | Gen 0 | Allocated | | ||
|-------- |---------:|--------:|--------:|--------:|------:|-------:|----------:| | ||
| DinoDNS | 126.5 us | 2.09 us | 1.95 us | 7,908.1 | 1.00 | 0.4883 | 2,274 B | | ||
|
||
👋 Know of a .NET DNS-over-TLS client? Raise a PR to add it as a comparison! | ||
|
||
### DNS-over-HTTPS | ||
|
||
An alternative to DNS-over-TLS is DNS-over-HTTPS, providing the same core functionality through a different method. | ||
This can disguise DNS traffic when performed over port 443 (the default port for HTTPS). | ||
|
||
| Method | Mean | Error | StdDev | Op/s | Ratio | Gen 0 | Allocated | | ||
|-------- |---------:|--------:|--------:|--------:|------:|-------:|----------:| | ||
| DinoDNS | 207.2 us | 3.77 us | 3.52 us | 4,827.1 | 1.00 | 1.4648 | 5,625 B | | ||
|
||
👋 Know of a .NET DNS-over-HTTPS client? Raise a PR to add it as a comparison! | ||
|
||
## ⭐ Example Usage | ||
|
||
```csharp | ||
var client = new DnsClient(new NameServer[] | ||
{ | ||
NameServers.Cloudflare.IPv4.GetPrimary(ConnectionType.Udp) | ||
}, DnsMessageOptions.Default); | ||
|
||
var dnsMessage = await client.QueryAsync("example.org", DnsQueryType.A); | ||
var aRecords = dnsMessage.Answers.WithARecords(); | ||
``` |