• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3const common = require('../common');
4
5const assert = require('assert');
6const dns = require('dns');
7
8dns.setDefaultResultOrder('ipv4first');
9let dnsOrder = dns.getDefaultResultOrder();
10assert.ok(dnsOrder === 'ipv4first');
11dns.setDefaultResultOrder('verbatim');
12dnsOrder = dns.getDefaultResultOrder();
13assert.ok(dnsOrder === 'verbatim');
14
15{
16  (async function() {
17    const result = await dns.promises.lookup('localhost');
18    const result1 = await dns.promises.lookup('localhost', { verbatim: true });
19    assert.ok(result !== undefined);
20    assert.ok(result1 !== undefined);
21    assert.ok(result.address === result1.address);
22    assert.ok(result.family === result1.family);
23  })().then(common.mustCall());
24}
25