Skip to content
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.setServers is undefined in native-dns, so not 1:1 with node's dns #108

Open
mnebuerquo opened this issue Dec 1, 2015 · 1 comment
Open

Comments

@mnebuerquo
Copy link

dns.setServers is undefined.

See this doc: https://nodejs.org/api/dns.html#dns_dns_setservers_servers

For a 1:1 replacement, it is necessary to use the same interface for changing name servers, rather than having to use dns.platform.name_servers.

I used this code to supply the needed function:

    if(undefined === dns.setServers){
        console.log('setServers is not defined');
        dns.setServers = function(list){
            dns.platform.name_servers = list.map(function(item){
                return {address:item};
            });
        };
    }
@kstankov
Copy link

And still not fixed. DOesn't work even with the code above.
UnhandledPromiseRejectionWarning: Error: Server object must be supplied with at least address
at new exports.Request (d:\Files\Code\node\MXTools\git\utils\DNStest\node_modules\native-dns\lib\client.js:62:11)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants