Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Generate /etc/whois.conf file for gnu whois command
/*
* Usage : node generateWhoisConf.js > /etc/whois.conf
*/
var json = require('comment-json');
var request = require('request');
request('https://github.com/weppos/whois/raw/master/data/tld.json', function(error, response, body){
var obj = json.parse(body);
Object.keys(obj).forEach(function(key){
if(obj[key].host){
console.log(key.replace(/\./g,'\\.') + '$ ' + obj[key].host);
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.