mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 19:25:56 +03:00
[GH-ISSUE #644] resolv.conf parsing fails when it contains a 'search …' line #260
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#260
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 @Flakebi on GitHub (Dec 22, 2018).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/644
Describe the bug
AsyncResolver::from_system_conffails if theresolv.conffile contains a line like this:To Reproduce
Steps to reproduce the behavior:
search Speedport_000to/etc/resolv.confAsyncResolver::from_system_conf()Expected behavior
trust-dnsworks like a charm, as it does normally.System:
Version:
Crate: resolver
Version: 0.10.1
Additional context
My complete
resolv.conf:Upper part of the backtrace:
@bluejekyll commented on GitHub (Dec 22, 2018):
Thanks for the report. I need to think about this one for a second. Technically speaking,
_is an invalid character in DNS names, which is what is triggering this failure to parse in thedomain::Nameimplementation._is only allowed as a prepended character for use mainly in SRV record.RFC 1034: https://tools.ietf.org/html/rfc1034#section-3.5
RFC 2782: https://tools.ietf.org/html/rfc2782 updates this to allow
_as a first char in the name.Of course, it's clear that
_is being used in the wild, so we should probably allow it. Possibly a parse strict vs. parse relaxed mode, based on context. We already do this for names received over the wire, so perhaps we should do this for all untrusted sources of names, likeresolv.conf.@bluejekyll commented on GitHub (Dec 22, 2018):
RFC 2181: https://tools.ietf.org/html/rfc2181#section-11
Clearly we’re being too restrictive with our names. I think the problem here is that, currently it’s the IDNA library we’re using for internationalization, and that is what is failing. To circumvent that, we can fail that, and then in “non-strict” mode, we can allow the name, though the fall back will be to treat it as ascii.
The earliest I can work on this is next week, but cannot make any promises.
@bluejekyll commented on GitHub (Dec 22, 2018):
Do you need this backported? to 0.10.x?
@Flakebi commented on GitHub (Dec 23, 2018):
Thanks a lot for the fast answer and investigation!
I just stumbled over this today so I thought I’ll report it. For me there is no pressure on this, all projects where i use trust-dns are a lot less complete than this library ;).
So I don’t need it backported, thanks for asking. :)
@bluejekyll commented on GitHub (Jan 12, 2019):
This has been backported to the 0.10 resolver.
@Victordmdb commented on GitHub (Jun 7, 2020):
Having a similar issue:
Error parsing resolve.conf: InvalidOption(5)resolve.conf(remove IP addresses):
@bluejekyll commented on GitHub (Jun 7, 2020):
Do you want to open a new issue for this? The “retrans” option might be at issue. The actual parsing is done by a 3rd party library, so it would be good to see if the issue is there.
@Victordmdb commented on GitHub (Jun 7, 2020):
Sure, didnt know if it was worth opening an issue, since i wasn't too sure what the issue was