Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Nodejs Script for DNS Lookup of IoT Cloud Platforms
var dns = require('dns');
function getIPAddresses(hostName){
dns.resolve4(hostName, function (err, addresses) {
if (err) throw err;
//console.log('Addresses: ' + JSON.stringify(addresses) );
addresses.forEach(function (a) {
dns.reverse(a, function (err, domains) {
if (err) {
console.log('Reverse for ' + a + ' For Hostname: ' + hostName + ' failed: ' +
err.message);
} else {
console.log('Reverse for ' + a + ' For Hostname: ' + hostName + ': ' +
JSON.stringify(domains));
}
});
});
});
}
getIPAddresses('developer.aylanetworks.com');
getIPAddresses('ide.electricimp.com');
getIPAddresses('developer.nest.com');
getIPAddresses('portals.exosite.com');
getIPAddresses('developer.axeda.com');
getIPAddresses('dev.evrythng.com');
getIPAddresses('BUILD.PARTICLE.IO');
getIPAddresses('api.smartthings.com');
getIPAddresses('devs.golgi.io');
getIPAddresses('developer.thingworx.com');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment