-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DNS resolution over specific interface #34818
Labels
dns
Issues and PRs related to the dns subsystem.
feature request
Issues that request new features to be added to Node.js.
Comments
If this is reasonable, I'm happy to take a stab at implementing. |
jasnell
added
dns
Issues and PRs related to the dns subsystem.
feature request
Issues that request new features to be added to Node.js.
labels
Aug 18, 2020
/cc @bnoordhuis |
aduh95
pushed a commit
to daguej/node
that referenced
this issue
Oct 24, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
dns
Issues and PRs related to the dns subsystem.
feature request
Issues that request new features to be added to Node.js.
Is your feature request related to a problem? Please describe.
On a system with multiple network interfaces, I would like to make DNS resolution requests over a specific interface.
I have a problem similar to #14617. Consider a Linux server with 2 interfaces, primary
eth0
and a backup internet connection using a LTE modem oneth1
. The system's default route is overeth0
, and in normal operation all traffic goes over that interface.If the primary connection is unavailable, I want to be able to make certain requests from my node program over the backup connection. However, the backup connection is metered, so I don't want a systemwide failover; only specific, high-priority requests should go over the backup.
With the appropriate alternate IP routing table and rules configured, this works for TCP sockets if you set
localAddress
when callingconnect(opts)
and already know the destination address. However, I need a way to resolve DNS over the backup connection if necessary — and separately from the system's default resolv.conf settings.Describe the solution you'd like
This could be accomplished similarly to the
localAddress
option available to TCP sockets. (There's alsobind(port, address)
available to UDP sockets.)eg:
I think this would be as simple as calling
ares_set_local_ip4
/ares_set_local_ip6
somewhere in cares_wrap.cc.The text was updated successfully, but these errors were encountered: