Query Domain Name availability with node.js via Amazon Web Services SDK.
Compatible with any Node.js app, just integrate this into your application. This is great for use with dns management, domain reservation services, or more advanced logic.
- Required IAM setup
- Need to configure IAM credentials with access to route53
Using awsdomainchecker is easy, simply export IAM environment variables for route53 access,
require my module (awsdomainchecker) in your app and your all done!
See here for instaling pip - https://pip.pypa.io/en/stable/installing/
See here for configuring IAM policy for route53 - http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/access-control-managing-permissions.html
pip install awscli
aws configure
npm install awsdomainchecker
const awsdomainchecker = require('awsdomainchecker');
Running it is easy, anytime your main app starts awsdomainchecker will auto-start You should get the returned output:
awsdomainchecker listening on http://localhost:8135
Locate the node_modules folder where you have my module 'awsdomainchecker', edit the index.js and change listening port
port = 8135;
app.listen(port);
app.use(bodyparser.urlencoded({extended: true}));
app.use(bodyparser.json());
app.get('/', function(req, res){
console.log('GET /')
const html = fs.readFileSync('index.html');
res.writeHead(200, {'Content-Type': 'text/html'});
res.end(html);
});
app.post('/', function(req, res){
console.log('POST /');
console.dir(req.body);
const route53domains = new AWS.Route53Domains();
res.writeHead(200, {'Content-Type': 'text/html'});
During testing, simply use curl to generate post request only specifying the domain name with top level domain. "domainname.tld".
You can add sanitization around this from your application UI side once running. Contributors to this project should also be looking
forward to oauth integration coming soon, in the mean-time security is on you to sanitize for the time being.
curl -d "DomainName=domain.com" localhost:8135
You should get the returned output:
This Domain is: status <UNAVAILABLE> | <AVAILABLE>
More to come soon....
Invented By: Sulayman Touray {C.E.O SudirlayCoders}