Skip to content

Instantly share code, notes, and snippets.

@jparrill
Created August 7, 2020 09:13
Show Gist options
  • Select an option

  • Save jparrill/e71f869570a5e798879f07e0c931170f to your computer and use it in GitHub Desktop.

Select an option

Save jparrill/e71f869570a5e798879f07e0c931170f to your computer and use it in GitHub Desktop.
google-ddns-domain-update Script
#!/bin/bash
USERNAME=""
PASSWORD=""
HOSTNAME="yoursubdomain.yourdomain.here"
# Resolve current public IP
IP=$(curl -s "https://domains.google.com/checkip")
# Update Google DNS Record
URL="https://${USERNAME}:${PASSWORD}@domains.google.com/nic/update?hostname=${HOSTNAME}&myip=${IP}"
curl -s $URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment