Skip to content

Instantly share code, notes, and snippets.

@calebhailey
Created February 21, 2020 20:24
Show Gist options
  • Save calebhailey/552ce595028e7e83a0e54c42ebe67b40 to your computer and use it in GitHub Desktop.
Save calebhailey/552ce595028e7e83a0e54c42ebe67b40 to your computer and use it in GitHub Desktop.
#!/usr/bin/sh
# Google Domains Dynamic DNS Updater Script
# See: https://support.google.com/domains/answer/6147083?hl=en
DDNS_USERNAME=xxxxxxxxxxxxxxxx
DDNS_PASSWORD=xxxxxxxxxxxxxxxx
DDNS_HOSTNAME=foo.yourcompany.com
DDNS_IPADDRESS=$(curl -s http://checkip.amazonaws.com)
DDNS_STATUS=$(curl -s -XPOST "https://${DDNS_USERNAME}:${DDNS_PASSWORD}@domains.google.com/nic/update?hostname=${DDNS_HOSTNAME}&myip=${DDNS_IPADDRESS}")
echo "$(date) ${DDNS_STATUS}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment