Saud’s Google Domains Dynamic DNS Updater: Installation, Configuration, and Tips

Saud’s Google Domains Dynamic DNS Updater — Easy Setup GuideDynamic DNS (DDNS) lets you associate a changing public IP address with a fixed hostname. If you host services at home — a web server, remote desktop, surveillance cameras, or VPN — DDNS keeps your domain name pointing to your current IP so you can reach those services without checking the address each time it changes. Saud’s Google Domains Dynamic DNS Updater is a lightweight tool designed to automatically update Google Domains’ Dynamic DNS records whenever your public IP changes. This guide walks you through what it does, why you might use it, and how to install, configure, and run it reliably.


Why use Saud’s updater?

  • Automatic updates: No manual DNS edits when your ISP assigns a new IP.
  • Works with Google Domains: Uses Google’s supported DDNS interface and your domain credentials.
  • Lightweight and scriptable: Suitable for routers, NAS devices, small home servers, and VPS instances.
  • Customizable: Can be run periodically via cron or as a persistent service/daemon.

How Google Domains Dynamic DNS works (brief)

Google Domains provides a simple endpoint for dynamic DNS updates. You create a synthetic record for Dynamic DNS in your Google Domains DNS settings, which generates a unique username and password for that host. To update the record, a client performs an HTTPS request with HTTP Basic Auth to Google’s update URL, providing the hostname and the new IP address (or letting Google infer the IP). A successful update returns a short status string.


Requirements

  • A domain managed in Google Domains.
  • A Dynamic DNS host entry configured in Google Domains (creates an update username and password).
  • A machine to run the updater: Linux, macOS, or other Unix-like system recommended (Windows is possible with adjustments).
  • Basic familiarity with the terminal and editing config files.
  • Optional: systemd for running as a persistent service, or cron for periodic runs.

Installation

This guide assumes Saud’s updater is distributed as a single Python script named sauds-ddns.py (adjust filenames if different). Replace commands with your package manager if needed.

  1. Install Python 3 if not already present (Python 3.8+ recommended).

    • Debian/Ubuntu: sudo apt update && sudo apt install -y python3 python3-venv python3-pip
    • Fedora: sudo dnf install -y python3 python3-pip
  2. Create a directory and download the script:

    mkdir -p ~/saud-ddns cd ~/saud-ddns # download the script (example) curl -O https://example.com/sauds-ddns.py chmod +x sauds-ddns.py 
  3. (Optional) Create a Python virtual environment and install dependencies:

    python3 -m venv venv source venv/bin/activate pip install --upgrade pip requests 

    If the script is self-contained and needs no extra packages, the venv step can be skipped.


Configuration

Create a configuration file to store your hostname and Google-provided credentials. For security, keep the file readable only by the user that will run the updater.

  1. Example config file (config.ini):
    
    [google] hostname = yoursubdomain.example.com username = generated-username-from-google password = generated-password-from-google check_interval = 300 ip_source = auto log_file = /var/log/saud-ddns.log 
  • hostname: the full host entry you created in Google Domains.
  • username/password: the Dynamic DNS credentials Google provided.
  • check_interval: how often (in seconds) the script checks for IP changes (300 = 5 minutes). Adjust to avoid excessive requests.
  • ip_source: “auto” (let Google infer IP) or set to “iface” or “external” depending on script features.
  • log_file: where to write logs; ensure directory exists and permissions are set.
  1. Protect the config:
    
    chmod 600 config.ini 

Manual test run

Run the script manually to ensure it updates correctly and logs output:

./sauds-ddns.py --config config.ini --once 

Expected responses:

  • A success message indicating IP updated, or
  • A message that the IP is unchanged, or
  • An error indicating authentication or network issues.

Common troubleshooting:

  • 401 Unauthorized: check username/password.
  • Network errors: ensure the host can reach Google’s update endpoint (HTTPS outbound allowed).
  • Permission denied when writing logs: adjust log_file path or permissions.

Running continuously: cron vs systemd

Option A — cron (periodic):

  1. Edit the user’s crontab:
    
    crontab -e 
  2. Add a line to run every 5 minutes:
    
    */5 * * * * /home/youruser/saud-ddns/sauds-ddns.py --config /home/youruser/saud-ddns/config.ini >> /home/youruser/saud-ddns/cron.log 2>&1 

Option B — systemd service (persistent, auto-restart):

  1. Create a systemd unit file /etc/systemd/system/saud-ddns.service: “`ini [Unit] Description=Saud Google Domains Dynamic DNS Updater After=network-online.target Wants=network-online.target

[Service] Type=simple User=youruser WorkingDirectory=/home/youruser/saud-ddns ExecStart=/home/youruser/saud-ddns/venv/bin/python /home/youruser/saud-ddns/sauds-ddns.py –config /home/youruser/saud-ddns/config.ini Restart=on-failure RestartSec=10 StandardOutput=append:/var/log/saud-ddns.log StandardError=append:/var/log/saud-ddns.log

[Install] WantedBy=multi-user.target

2. Reload systemd and enable: ```bash sudo systemctl daemon-reload sudo systemctl enable --now saud-ddns.service sudo journalctl -u saud-ddns -f 

Security considerations

  • Protect your Dynamic DNS credentials: store in a file with mode 600.
  • Use a dedicated, low-privilege user to run the updater rather than root.
  • Limit log exposure — avoid logging credentials.
  • If possible, restrict outgoing connections on your network to only necessary hosts; ensure HTTPS to Google Domains is permitted.

Advanced tips

  • IPv6 support: if your ISP provides IPv6, check whether the script and Google Domains record support AAAA updates.
  • Rate limits: avoid very short check intervals — 5 minutes is typical. Excessive updates may be rejected.
  • Backup: keep a copy of your configuration and service unit in your dotfiles or configuration management.
  • Notifications: integrate with a notification system (email/Telegram/pushover) to alert on repeated failures.
  • Containerize: run the updater in a small Docker container for isolation on NAS devices or cloud VMs.

Troubleshooting checklist

  • Verify Dynamic DNS entry exists in Google Domains and you copied the credentials exactly.
  • Test network connectivity to Google (curl https://domains.google.com/nic/update).
  • Check logs for HTTP status codes and error messages.
  • Confirm the script has execute permission and config is readable only by the owner.
  • If using systemd, check journalctl for service start failures.

Example: minimal Python update request

If you want to see the core of how an update works, here’s a minimal example (do not store credentials in plaintext for production use):

import requests from requests.auth import HTTPBasicAuth username = "google-ddns-username" password = "google-ddns-password" hostname = "yoursubdomain.example.com" resp = requests.get(     "https://domains.google.com/nic/update",     params={"hostname": hostname},     auth=HTTPBasicAuth(username, password),     timeout=10, ) print(resp.status_code, resp.text) 

A successful update returns strings like “good 203.0.113.10” or “nochg 203.0.113.10”. Errors include “badauth” or “notfqdn”.


Wrap-up

Saud’s Google Domains Dynamic DNS Updater provides a simple, reliable way to keep a Google Domains host pointing at your current IP. Set it up with protected credentials, run it as a service or cron job, and monitor logs for errors. With a few minutes of configuration you’ll have continuous, automated DNS updates that keep your home services reachable.

If you want, I can: provide a ready-to-use script tailored to your environment, create the systemd unit with your username filled in, or show how to containerize the updater.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *