Skip to content

Instantly share code, notes, and snippets.

@pinscript
Created August 25, 2015 06:49
Show Gist options
  • Save pinscript/38ac3683467cdfbe77e2 to your computer and use it in GitHub Desktop.
Save pinscript/38ac3683467cdfbe77e2 to your computer and use it in GitHub Desktop.
Google Spreadsheet function to lookup IP for a hostname
function getIP(host) {
var url = "https://freegeoip.net/json/" + host;
var json = UrlFetchApp.fetch(url);
var data = JSON.parse(json);
return data["ip"];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment