mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 11:15:54 +03:00
[GH-ISSUE #2042] trust-dns only warns instead of returning Err when it has no nameservers listed in /etc/resolv.conf #857
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#857
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 @knightian on GitHub (Oct 2, 2023).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2042
Describe the bug
If a unix system has no nameserver entries in /etc/resolv.conf for some reason, trust-dns warns that it can find no nameservers, but it allows applications to continue to send DNS queries despite it having no nameservers to lookup those queries.
I think it should not just be a warning written to log, I think if trust-dns is unable to perform DNS lookups, this is not a warning, this is an error because trust-dns cannot do what it is needed to do.
@djc commented on GitHub (Oct 2, 2023):
Do you mean the daemon or one of the libraries? For the daemon, I think it could plausibly still serve other parts of the config even if it was unable to resolve via an upstream resolver?
@knightian commented on GitHub (Oct 2, 2023):
Oh the rust crate used by Vaultwarden. The issue has more depth on this thread: https://github.com/dani-garcia/vaultwarden/discussions/3941#discussioncomment-7163895
[2023-10-02 00:59:53.441][trust_dns_resolver::system_conf::unix][WARN] no nameservers found in configit is writing a warning to be logged, but it is not throwing an
Errso devs are still trying to perform queries with a resolver that has no nameservers.@djc commented on GitHub (Oct 2, 2023):
Ahh, so yes, if you're instantiating a resolver from trust-dns-resolver I definitely agree it makes sense to yield an error for this case. Are you able to submit a PR?
@knightian commented on GitHub (Oct 2, 2023):
I have honestly never looked at coding in rust in my life. If I knew what I were doing I would.
@knightian commented on GitHub (Oct 2, 2023):
In saying that, I'm sure I can have a crack at it, as it's just going to be a matter of finding that warning in the code and changing that log write to an exception throw, 5 minutes of google should educate me, I can have a crack at it I guess, assuming it's relatively straight forward to tool up for rust.
@knightian commented on GitHub (Oct 2, 2023):
@djc I think I have done it, this is the result of me googling how to raise an Err https://github.com/bluejekyll/trust-dns/pull/2043