LLT-7052: DNS packet codec#1688
Conversation
8bc69ea to
50ec209
Compare
50ec209 to
b87a3d4
Compare
b87a3d4 to
9bbe892
Compare
9bbe892 to
87a56cb
Compare
87a56cb to
1f03629
Compare
stalowyjez
left a comment
There was a problem hiding this comment.
I have mixed feeling for this PR, reducing dependencies is always nice, but it feels a bit like reinventing the wheel. We also have some code in libfirewall which does some DNS parsing, maybe we should create some public DNS helper crate for pnet which would address our needs?
stalowyjez
left a comment
There was a problem hiding this comment.
Looks good enough, +1
I have the same feeling, and I'm also missing explanation why we want to "get rid of all hickory_server dependencies." |
And what if they are not? |
|
Please, remember to cleanup (squash?) commits. |
408a415 to
327fb7f
Compare
|
+1 |
327fb7f to
8c89718
Compare
|
Next time: It would be really nice to include ticket number in the branch name 🙏 🙏 🙏 |
20db861 to
e68879a
Compare
e68879a to
b6c2f87
Compare
This module incorporates: - a lightweight decoder, that converts DNS request bytes into a `DnsPacket<'_>`, and exposes a helper functions like `parse_dns_query_packet()`, `find_nord_query()` and `normalize_qname()` to simplify with the correct request handling. - A packet builder specific for the local resolver use case, that converts a `ResponseKind` enum into appropriate DNS response bytes.
b6c2f87 to
009dbae
Compare
Problem
We want to get rid of all
hickory_serverdependencies, because it set's up a full blown DNS server, we maintain our own (outdated) fork of, and it was source of a lot of bugs.As a first step we need to decide if DNS requests are related to
.nordzone.If they are, they should handled by our local resolver, and we need to serve the response packet back.
If not, the request is forwarded and resolved by the upstream nameservers.
Solution
This module incorporates:
DnsPacket<'_>struct, and exposes a helper functions likeparse_dns_packet(),find_nord_query()andnormalize_qname()to simplify with the correct request handling.ResponseKindenum into appropriate DNS response bytes.☑️ Definition of Done checklist