This PR adds a net::server module to domain that enables the creation of UDP and TCP DNS servers using base transport server, middelware and service building blocks.
For examples of the code in use see:
RustDoc tests.
examples/server-transports.rs - if you run this it prints various suggested dig commands you can run to see it in action.
Various things could be improved even without review feedback:
[x] The examples/serve.rs is not neat and tidy at all and should maybe be split into multiple examples. - Resolution: Tidied up a bit.
[x] I'm not sure if the net::server::prelude is a good idea or not. - Resolution: Removed.
[ ] The code doesn't currently adhere completely to our desired coding guidelines.
[x] The tests in net::server::tests haven't been looked at for a long time. - Resolution: Reviewed, added some comments, did some minor cleanup.
[x] The skeleton for dynamic reconfiguration support is present but not yet used. - Resolution: It is now used.
[x] The EDNS(0) timeout support might have the wrong idea about what EDNS(0) timeouts are, I haven't looked back at that for a long time. - Resolution: This has been checked and updated.
[x] The TODOs present in the code should be revisited. - Resolution: Many TODOs have been resolved, some have been deliberately left behind as they require more thought.
[x] No bechmarking / performance testing has been done yet. - Resolution: Localhost testing with dnsperf and the 1M query set has been done yielding ~1.5M query/sec on the test machine for both UDP and TCP. This was done using the zone tree support in PR #286.
[x] This PR doesn't have the discussed zonefile support yet. - Resolution: See PR #286.
[x] Review remaining calls to unwrap() - Resolution: Unwraps removed, explained with SAFETY comment, or converted to expect() if truly fatal.
This PR also introduces tokio-tracing for async friendly context aware logging, e.g. one can capture the dns message id high up in a call tree and have it automatically included in a log message from deep in the call tree which I think is potentially very useful.
This PR is also probably incompatible with --no-default-features as that would disable the std feature yet this PR currently uses std functionality.
However, I think it's a good moment to take a look at it as-is.
This PR adds a
net::server
module todomain
that enables the creation of UDP and TCP DNS servers using base transport server, middelware and service building blocks.For examples of the code in use see:
examples/server-transports.rs
- if you run this it prints various suggesteddig
commands you can run to see it in action.net-server.rs
.Various things could be improved even without review feedback:
examples/serve.rs
is not neat and tidy at all and should maybe be split into multiple examples. - Resolution: Tidied up a bit.net::server::prelude
is a good idea or not. - Resolution: Removed.net::server::tests
haven't been looked at for a long time. - Resolution: Reviewed, added some comments, did some minor cleanup.dnsperf
and the 1M query set has been done yielding ~1.5M query/sec on the test machine for both UDP and TCP. This was done using the zone tree support in PR #286.unwrap()
- Resolution: Unwraps removed, explained with SAFETY comment, or converted to expect() if truly fatal.This PR also introduces tokio-tracing for async friendly context aware logging, e.g. one can capture the dns message id high up in a call tree and have it automatically included in a log message from deep in the call tree which I think is potentially very useful.
This PR is also probably incompatible with
--no-default-features
as that would disable thestd
feature yet this PR currently usesstd
functionality.However, I think it's a good moment to take a look at it as-is.