Skip to content

clayshek/google-ddns-updater

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

google-ddns-updater

GoLang Google Domains Dynamic DNS Update Client

Summary

google-ddns-updater is a program, writen in Go, for updating Google Domains dynamic DNS records via the Google Domains API. See Google documentation for API usage and other details: https://support.google.com/domains/answer/6147083?hl=en

ggoogle-ddns-updater will compare the current external IP address as obtained from http://myexternalip.com, with the currently resolving IP address of the DNS record. If they are identical, no further action is taken other than logging. If they differ, an authenticated request is sent to the Google Domains API to update the record, with logging of the request response and status.

Requirements

  • An existing dynamic DNS record hosted by Google Domains
  • Environment variables set for GOOG_DDNS_HOSTNAME, GOOG_DDNS_USERNAME, & GOOG_DDNS_PASSWORD

Usage

Standalone Binary

  • Clone this repository
  • Build the binary from src for your architecture: go build
  • Set environment variables for GOOG_DDNS_HOSTNAME, GOOG_DDNS_USERNAME, & GOOG_DDNS_PASSWORD
  • Run google-ddns-updater

Container Image

Kubernetes

  • The included ddns-k8s-deployment.yml file can be used to pull the continer image into a Kubernetes or K3s cluster, which runs as an hourly CronJob. The secrets must be populated in the deployment file to be passed as environment variables to the pod.

To-Do

  • Improve logging
  • Add better code comments
  • Versioning
  • Create Helm chart