2017-05-17 05:36:15 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
// We don't care about `err` in the callback function of `dns.resolve4`. We just
|
|
|
|
// want to test whether `dns.setServers` that is run after `resolve4` will cause
|
|
|
|
// a crash or not. If it doesn't crash, the test succeeded.
|
|
|
|
|
|
|
|
const common = require('../common');
|
2017-10-22 18:07:54 +00:00
|
|
|
const { addresses } = require('../common/internet');
|
2017-05-17 05:36:15 +00:00
|
|
|
const dns = require('dns');
|
|
|
|
|
2017-10-22 18:07:54 +00:00
|
|
|
dns.resolve4(
|
|
|
|
addresses.INET4_HOST,
|
|
|
|
common.mustCall(function(/* err, nameServers */) {
|
|
|
|
dns.setServers([ addresses.DNS4_SERVER ]);
|
|
|
|
}));
|
2017-11-15 07:09:33 +00:00
|
|
|
|
|
|
|
// Test https://github.com/nodejs/node/issues/14734
|
|
|
|
dns.resolve4(addresses.INET4_HOST, common.mustCall());
|