Created
July 28, 2020 21:31
-
-
Save antoniodvr/1193d29a37e01bbcad6a1f463a31467e to your computer and use it in GitHub Desktop.
Google Domains Dynamic DNS Update Script
This file contains 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
#!/bin/bash | |
### Google Domains provides an API to update a DNS "Syntheitc record". This script | |
### updates a record with the script-runner's public IP, as resolved using a DNS | |
### lookup. | |
### | |
### Google Dynamic DNS: https://support.google.com/domains/answer/6147083 | |
### Synthetic Records: https://support.google.com/domains/answer/6069273 | |
HOSTNAME="yoursubdomain.domain.tld" | |
USERNAME="yourdyndnsuser" | |
PASSWORD="yourdyndnspassword" | |
IP=$(curl -s "https://domains.google.com/checkip") | |
URL="https://domains.google.com/nic/update?hostname=${HOSTNAME}&myip=${IP}" | |
curl --user ${USERNAME}:${PASSWORD} -s $URL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment