function toto(ip){ const dns = require('dns'); dns.reverse(ip, function(err, domains) { dns.setServers(['10.1.5.4', '10.15.5.2']); if (domains) { console.log(JSON.stringify(domains)); } else { callback(err.code); } }); }; toto('10.16.4.16');
On console i have : ["sertest"]----PS : can i have this var tata=toto('10.16.4.16'); ?