You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the time I think that the dns servers in use by dns.resolve*() are set in a global state. So in theory you could do something like this:
var dns = require('dns');
dns.setServers(['10.10.1.200', '10.10.1.199']);
var request = require('srv-request');
...rest of your code...
Be mindful that calling dns.setServers() while a dns request is in progress will crash your code so don't be setting this except at startup. And it will also direct other dns.resolve*() of your app or required modules to that server not only those in use by srv-request. But dns.lookup() uses the systems getaddrinfo(3) so it will not be changed.
I'm not set up to test this right now but please try it and let me know if it did the trick. Otherwise we might have to wait for PR nodejs/node#1843 to be approved.
Hi, It's possible to set the dns server used to resolve the SRV request ?
The text was updated successfully, but these errors were encountered: