Created
May 5, 2016 18:38
-
-
Save AshuJoshi/22eee0882ccdd6e4d5eddce8f94e2bfd to your computer and use it in GitHub Desktop.
Nodejs Script for DNS Lookup of IoT Cloud Platforms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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