mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-24 18:55:55 +03:00
[GH-ISSUE #1309] Clarification regarding Authority #647
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#647
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jonasbb on GitHub (Dec 2, 2020).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1309
Currently, I am trying to implement an authoritative DNS server with the help of
trust-dns-server. I am not sure what exactly the difference betweenAuthority::lookupandAuthority::searchis. It sounds like the only difference is if I give it a query with separate name and type components or combined into aLowerQuery.However, this is not the case for the
InMemoryAuthority(implementation).searchforwards tolookupin some cases but also implements some additional logic.Some parts, for example the handling of
SOAentries, I do not understand.github.com/bluejekyll/trust-dns@028ac68ee0/crates/server/src/store/in_memory/authority.rs (L990-L993)This code snippet always returns a SOA record for the zone root, if the query is of type SOA but ignoring the query name.
This is not how SOAs are usually processed. A SOA is included in a NODATA response because the miminum value of the SOA is needed for the negative caching. The SOA is in the authority section. The
InMemoryAuthority::searchfunction from above will, however, put the SOA in the answer section.So my question is what is the intended difference between these two functions?
@bluejekyll commented on GitHub (Dec 29, 2020):
Late reply. There may be a degenerate case here that's happening? The intention is to reply with the SOA in any case where a record is not found, which I thought was standard practice.
In terms of the difference between
queryandlookup, there may be little to no difference. Back when I refactored the code to allow for different types of authorities, I was trying to share as much code as possible, so it might be left over from that and perhaps one isn't needed and can be removed? We'll have to do some code spelunking to figure that out.@jonasbb commented on GitHub (Dec 29, 2020):
Hi, thanks for the reply.
Yes it is standard practice to include a SOA in this case. The SOA should go into the authority section in this case. The code will put the SOA into the answer section though.
From the initial post:
Just to clarify, you mean
searchhere instead ofquery, right?@djc commented on GitHub (Dec 29, 2020):
@jonasbb doing a bunch of refactoring in the server recently, I'd be happy to work with you to figure out how the current design can be simplified.
@bluejekyll commented on GitHub (Dec 29, 2020):
Ah, yes, that should be fixed. Thanks for catching that.
Yes. I was looking at the code and the only difference in the signatures is that one takes
Queryand the other aLowerNameandRecordType. So I confused myself in the response to your question. Again, I'm not sure when/why I decided that made sense...@jonasbb commented on GitHub (Dec 30, 2020):
@djc Thanks for the info. I also saw the new release. I will check out what kind of changes there are. I also joined the Discord channel, so I am happy to discuss stuff either there or on GitHub.
For my use case I had trouble getting the standard
MessageResponseto work for me, since due to the embedded lifetimes I found it hard to dynamically create a response. That is, having a function, which given a QNAME (and maybe a QTYPE) return aMessageResponsewhich has some dynamic value, e.g., the current time. I'm happy to expand on my use cases.