2017-05-17 07:36:15 +02: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 20:07:54 +02:00
|
|
|
const { addresses } = require('../common/internet');
|
2017-05-17 07:36:15 +02:00
|
|
|
const dns = require('dns');
|
|
|
|
|
2017-10-22 20:07:54 +02:00
|
|
|
dns.resolve4(
|
|
|
|
addresses.INET4_HOST,
|
|
|
|
common.mustCall(function(/* err, nameServers */) {
|
|
|
|
dns.setServers([ addresses.DNS4_SERVER ]);
|
|
|
|
}));
|
2017-11-15 08:09:33 +01:00
|
|
|
|
|
|
|
// Test https://github.com/nodejs/node/issues/14734
|
|
|
|
dns.resolve4(addresses.INET4_HOST, common.mustCall());
|