node-dns icon indicating copy to clipboard operation
node-dns copied to clipboard

native-dns 1:1 mapping of the upstream node.js dns module is broken

Open mdebruijne opened this issue 10 years ago • 0 comments

Hi,

See below for scripts to reproduce the errors and the output when running these scripts. The only difference between these scripts is the usage of upstream node.js dns versus native-dns.

I think that the scripts and outputs are self-explanatory, but if more information is required then please let me know.

This is with node version 0.12 and native-dns version 0.7.0.


"use strict";

var dns = require("dns");
//var dns = require("native-dns");

var ip = "199.180.112.34";

dns.reverse(ip, function (err, hostnames) {
  if (err) {
    console.log(err);
  } else {
    console.log(hostnames);
  }
});

$ node dns.js
{ [Error: getHostByAddr ENOTFOUND 199.180.112.34]
  code: 'ENOTFOUND',
  errno: 'ENOTFOUND',
  syscall: 'getHostByAddr',
  hostname: '199.180.112.34' }

"use strict";

//var dns = require("dns");
var dns = require("native-dns");

var ip = "199.180.112.34";

dns.reverse(ip, function (err, hostnames) {
  if (err) {
    console.log(err);
  } else {
    console.log(hostnames);
  }
});

$ node dns.js
undefined

mdebruijne avatar Mar 15 '15 22:03 mdebruijne