Skip to content

Instantly share code, notes, and snippets.

View zpamio's full-sized avatar

Burak Tatlisert zpamio

View GitHub Profile
@ciaranmahoney
ciaranmahoney / Google Sheets MX Lookup
Last active October 22, 2024 23:22
Google Apps Script to Run MX Lookups on domains from Google Sheets
function MXLookup(domain) {
try {
var url = "https://dns.google.com/resolve?name=%FQDN%&type=MX".replace("%FQDN%",domain);
//var url = "https://dns.google.com/resolve?name=e-mercy.com&type=MX"; // USED FOR TESTING ONLY
Utilities.sleep(100);
var result = UrlFetchApp.fetch(url,{muteHttpExceptions:true});
var rc = result.getResponseCode();