Skip to content

Instantly share code, notes, and snippets.

@seripap
Created December 18, 2015 16:05
Show Gist options
  • Save seripap/d0cd7bc2ac151d0f32c9 to your computer and use it in GitHub Desktop.
Save seripap/d0cd7bc2ac151d0f32c9 to your computer and use it in GitHub Desktop.
DNS domain check
'use strict';
import dns from "dns";
import sys from "sys";
import fs from "fs";
const items = JSON.parse(fs.readFileSync('./shake.json'));
function checkAvailable(name, callback) {
dns.resolve4( name, (err, addresses) => {
if (err) console.log (name + " is possibly available : " + err)
});
}
for (let i = 0; i < items.length; i++) {
checkAvailable(items[i] + ".com", sys.puts);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment