var dns = require('dns');
console.log("Rozpoznawanie nazwy www.google.com . . .");
dns.resolve4('www.google.com', function (err, addresses) {
  console.log('Adresy IPv4: ' + JSON.stringify(addresses, false, ' '));
  addresses.forEach(function (addr) {
    dns.reverse(addr, function (err, domains) {
      console.log('Wyszukiwanie odwrotne dla adresu ' + addr + ': ' + JSON.stringify(domains));
    });
  });
});