mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[GH-ISSUE #2220] Allow passing in a custom client UDP socket to send data from #926
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#926
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 @jamilbk on GitHub (May 24, 2024).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2220
Is your feature request related to a problem? Please describe.
We use hickory (thanks for the library!) to send DNS requests from a VPN tunnel process. If the server we're sending the requests to happens to be in the VPN's routing table (for example,
0.0.0.0/0for full-route tunneling), a packet loop ensues and the request never reaches the server. This is because we have no control over the socket created by hickory to send the query from.Describe the solution you'd like
It would be great if there was some way to pass in our own socket so that we can configure it as necessary to prevent packet loops. Another option would be to somehow return or expose a function for "getting at" the socket so we can apply the necessary config to it then.
Describe alternatives you've considered
Forking hickory to implement our own patch.
Additional context
This would be mainly used for Android and Linux platforms that don't have automatic packet loop detection, and instead rely on
protectin Android andfwmarkin Linux to signal to the routing table not to route the packet back into the VPN interface. Apple's NECP seems to automagically prevent this case for Apple platforms (macOS / iOS tested).@djc commented on GitHub (May 25, 2024):
Which library are you using? Are you able to use a custom
RuntimeProviderfor this?@fmartinsons commented on GitHub (May 28, 2024):
Hello, I recently encounter the need described by @jamilbk , I need to perform DNS request which follow a specific routing table, I have a
wwan0interface expose by some LTE USB dongle and the setup of to use name server configured for this interface, we must bind to it.Long story short, I would like to use bind_device
@djc As my previous link suggested , I use tokio and the specific config for that in hickory.
Do you see a way to customize the underlying socket that will be used inside hickory ?
Thanks !
@djc commented on GitHub (May 28, 2024):
You haven't really answered the question in my previous comment.
@fmartinsons commented on GitHub (May 28, 2024):
Sorry, I may have misunderstood but I don't see what kind of library you want to know, in this context, I thought it was the async runtime.
For the second part, it seems you suggest to look at using a custom RuntimeProvider and by the look at the link you provided, the socket is exposed there.
I'll give it a try and come back here if I manage to come up with something working.
Thanks
@fmartinsons commented on GitHub (May 29, 2024):
Ok that was fairly easy thanks to this example I managed to use bind_device to the socket returned by bind_udp trait method and it perfectly fit what I wanted.
Thank you very much @djc for the help.