Skip to content

Instantly share code, notes, and snippets.

@dineshsprabu
Created January 29, 2016 09:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dineshsprabu/2ad85cd559a7fd5da530 to your computer and use it in GitHub Desktop.
Save dineshsprabu/2ad85cd559a7fd5da530 to your computer and use it in GitHub Desktop.
Check MX Record for domains
/* npm install dns */
var dns = require('dns');
/* domain name to check for record */
domain_name = '<domain-name>';
/* dns.resolveMx can do the job for us */
dns.resolveMx(domain_name, function(err, addresses){
if(err){ return console.log(err.stack);}
console.log(addresses);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment