How to use the dns.resolve4 function in dns

To help you get started, we’ve selected a few dns examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github datastax / nodejs-driver / lib / control-connection.js View on Github external
function resolve4(next) {
      dns.resolve4(name, function resolve4Callback(err, arr) {
        if (arr) {
          arr.forEach(address => addresses.push({ address, isIPv6: false }));
        }
        // Ignore error
        next();
      });
    },
    function resolve6(next) {
github apigee / trireme / node10 / node10tests / internet / test-dns.js View on Github external
TEST(function test_resolve4(done) {
  var req = dns.resolve4('www.google.com', function(err, ips) {
    if (err) throw err;

    assert.ok(ips.length > 0);

    for (var i = 0; i < ips.length; i++) {
      assert.ok(isIPv4(ips[i]));
    }

    done();
  });

  checkWrap(req);
});
github shadowsocks / shadowsocks-manager / services / manager.js View on Github external
return new Promise((resolve, reject) => {
    dns.resolve4(address, (err, ips) => {
      if(err) {
        return reject(err);
      }
      if(ips.sort) {
        ips = ips.sort();
      }
      return resolve(ips);
    });
  });
};
github eviltik / evilscan / libs / options.js View on Github external
(next) => {
            if (target.match(/[a-z]/i) && !target.match(/\//) && !net.isIPv6(target)) {
                dns.resolve4(target, next);
            } else {
                next(null,[[target]]);
            }
        }
    ],(err,result) => {
github eviltik / evilscan / libs / optionsParser.js View on Github external
function(next) {
            if (target.match(/[a-z]/i) && !target.match(/\//) && !net.isIPv6(target)) {
                dns.resolve4(target,next);
            } else {
                next(null,[[target]]);
            }
        }
    ],function(err,result) {

dns

A DNS Server with a REST API

MIT
Latest version published 10 years ago

Package Health Score

42 / 100
Full package analysis