• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3// We don't care about `err` in the callback function of `dns.resolve4`. We just
4// want to test whether `dns.setServers` that is run after `resolve4` will cause
5// a crash or not. If it doesn't crash, the test succeeded.
6
7const common = require('../common');
8const { addresses } = require('../common/internet');
9const dns = require('dns');
10
11dns.resolve4(
12  addresses.INET4_HOST,
13  common.mustCall(function(/* err, nameServers */) {
14    dns.setServers([ addresses.DNS4_SERVER ]);
15  }));
16
17// Test https://github.com/nodejs/node/issues/14734
18dns.resolve4(addresses.INET4_HOST, common.mustCall());
19