mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[GH-ISSUE #1099] Use res_init to obtain unix DNS configurations? #605
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#605
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 @Mygod on GitHub (May 10, 2020).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1099
/etc/resolver.confmight not be the best way to do this, e.g. Android does not have this file. Perhaps we could try to useres_initorres_ninitas per this answer?@bluejekyll commented on GitHub (May 10, 2020):
Seems reasonable. I'm not sure if we want this across the board, but clearly for Android this would be a good change.
Trust-DNS used to have internal parsing logic for resolv.conf, but that was all migrated to the
resolv-confcrate. My suggestion is that we either put an FFI into that crate, or create a new separate crate that returns the same structures as theresolv-confcrate.I'd be happy for us to integrate this for Android initially, and then see about using it at some point in the future across more OSes.
@Mygod commented on GitHub (May 10, 2020):
Another thing to take into consideration is that DNS nameservers are subject to change, especially on a mobile device (disconnecting from a Wi-Fi might cause the device to use another nameserver). Android has a native async resolve API, but that was only added in Android 10. This
res_initapproach might be preferable for legacy versions.@bluejekyll commented on GitHub (May 10, 2020):
Yes, we don't currently have a strong design around the dynamic nature of DNS configuration on mobile (or less frequently laptops). It is something that we should support, at the moment, it would require a new resolver to be constructed on configuration changes.
I'm assuming
res_initwill change upon any change to DNS configuration at the OS level.@Mygod commented on GitHub (May 10, 2020):
Well I have bad news for you...
@bluejekyll commented on GitHub (May 10, 2020):
What's the bad news? that's all stdlib related, isn't it? res_init has FFI in libc, should be exposed on Android, isn't that the start to what we want?
@Mygod commented on GitHub (May 10, 2020):
Oh the point is that
res_initseems to cache system resolver configuration at the time of invocation instead.@bluejekyll commented on GitHub (May 11, 2020):
Ah. I see.
@Mygod commented on GitHub (May 20, 2020):
Looks like
res_ninitis buggy as well. We should stick to current implementation perhaps.