Last active
September 8, 2018 14:43
-
-
Save HugoPoi/4694a99f5a9d9b2c558557bbdd113f54 to your computer and use it in GitHub Desktop.
Generate /etc/whois.conf file for gnu whois command
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
/* | |
* 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