Skip to content

Instantly share code, notes, and snippets.

@AshuJoshi
Created May 5, 2016 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AshuJoshi/22eee0882ccdd6e4d5eddce8f94e2bfd to your computer and use it in GitHub Desktop.
Save AshuJoshi/22eee0882ccdd6e4d5eddce8f94e2bfd to your computer and use it in GitHub Desktop.
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