Last active
May 13, 2018 17:48
-
-
Save mittsh/bda215aea852f5f95dffc776241135b6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const domainUsesGoogleMail = domain => { | |
return fetch('https://dns.google.com/resolve?name=' + encodeURIComponent(domain) +'&type=MX').then(res => res.json()).then(d => { | |
return d.Answer.reduce((acc, val) => { | |
return acc || (val.data.indexOf('google.com.') >= 0 || val.data.indexOf('googlemail.com.') >= 0) | |
}, false) | |
}) | |
} | |
const showMailServer = domain => { | |
domainUsesGoogleMail(domain).then(r => { | |
console.log(r ? `${domain} uses Google Mail` : `${domain} does not use Google Mail`) | |
}) | |
} | |
showMailServer('paw.cloud') | |
showMailServer('l214.com') | |
showMailServer('rain-blog.com') | |
showMailServer('microsoft.com') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment