tjfontaine / node-dns

Replacement dns module in pure javascript for node.js
MIT License
585 stars 154 forks source link

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

Open mdebruijne opened 9 years ago

mdebruijne commented 9 years ago

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