Google Domains was officially shut down in 2023 and its assets were transferred to Squarespace. However, the foundational concepts of Dynamic DNS (DDNS) and the API protocols used for automating IP updates remain highly relevant for developers using alternative registry services.
Here is a comprehensive, technical article based on your title.
Saud’s Google Domains Dynamic DNS Updater: Automated IPv4 & IPv6 Setup
Maintaining a reliable connection to a home server, lab, or private network can be a moving target. Most residential internet service providers (ISPs) change your public IP address periodically. If you are hosting services, a shifting IP means your domain name will eventually point to a dead end.
Saud’s Google Domains Dynamic DNS (DDNS) Updater solves this problem. It is a lightweight, automated script designed to track your network’s changing IPv4 and IPv6 addresses and immediately push those updates to your domain registrar.
This guide covers how the updater works, how to configure your DNS credentials, and how to deploy the script for dual-stack (IPv4/IPv6) automation. The Core Problem: Dynamic IPs & Dual-Stack Networks
Most automated DDNS clients only look for an IPv4 address (A records). As the web transitions to IPv6, modern self-hosters need a solution that updates both:
A Records: Maps your domain to a 32-bit IPv4 address (e.g., 192.0.2.1).
AAAA Records: Maps your domain to a 128-bit IPv6 address (e.g., 2001:db8::1).
Saud’s updater queries external IP lookup services independently for both protocols, ensuring your domain remains reachable regardless of how a client connects to your network. Prerequisites
Before deploying the script, ensure you have the following ready:
A Compatible Registrar Account: While originally built for the Google Domains API syntax, this script works seamlessly with registrars that inherited Google’s infrastructure (like Squarespace) or those supporting standard HTTP Basic Authentication DDNS protocols.
DDNS Credentials: Generated username and password specifically for your sub-domain.
A Host Machine: A Linux server, Raspberry Pi, or Network Attached Storage (NAS) device that remains powered on. Step 1: Generating Your DDNS Credentials
To secure your primary account, registrars require unique credentials for dynamic record updates. Log into your domain registrar dashboard. Navigate to the DNS Settings or Advanced Tab.
Locate the Dynamic DNS section and add a new record (e.g., ://yourdomain.com).
Click View Credentials to see the auto-generated Username and Password. Copy these securely. Step 2: The Updater Script
This bash script uses curl to detect your public IPs and sends an authenticated API request to update the DNS records. Create a file named ddns_updater.sh:
#!/bin/bash # — CONFIGURATION — USERNAME=“your_ddns_username” PASSWORD=“your_ddns_password” HOSTNAME=“://yourdomain.com” # ——————— # Fetch current public IPv4 and IPv6 addresses CURRENT_IPV4=\((curl -s -4 https://google.com || curl -s -4 https://ipify.org) CURRENT_IPV6=\)(curl -s -6 https://google.com || curl -s -6 https://ipify.org) echo “Detected IPv4: \(CURRENT_IPV4" echo "Detected IPv6: \)CURRENT_IPV6” # Update IPv4 (A Record) if [ ! -z “\(CURRENT_IPV4" ]; then echo "Updating IPv4 A record..." RESPONSE_V4=\)(curl -s “https://\({USERNAME}:\){PASSWORD}@://google.com{HOSTNAME}&myip=\({CURRENT_IPV4}") echo "IPv4 Update Response: \)RESPONSE_V4” fi # Update IPv6 (AAAA Record) if [ ! -z “\(CURRENT_IPV6" ]; then echo "Updating IPv6 AAAA record..." RESPONSE_V6=\)(curl -s “https://\({USERNAME}:\){PASSWORD}@://google.com{HOSTNAME}&myip=\({CURRENT_IPV6}") echo "IPv6 Update Response: \)RESPONSE_V6” fi Use code with caution. Make the Script Executable
Run the following command in your terminal to grant execution permissions: chmod +x ddns_updater.sh Use code with caution. Step 3: Automating Execution with Cron
Running the script manually defeats the purpose of automation. Use the Linux cron utility to execute the updater at a set interval (e.g., every 15 minutes). Open the crontab editor: crontab -e Use code with caution.
Add the following line at the bottom of the file (replace with your actual script path):
*/15/path/to/ddns_updater.sh >> /var/log/ddns_updater.log 2>&1 Use code with caution.
Save and exit. The script will now run silently in the background every 15 minutes, logging its output to /var/log/ddns_updater.log. Understanding API Responses
When the script communicates with the API, the server will return specific status codes. Here is what they mean:
good [IP_ADDRESS]: The update was successful, and the record has changed.
nochg [IP_ADDRESS]: The update was successful, but the IP address has not changed since the last request.
badauth: The username and password combination is incorrect.
nohost: The hostname specified does not exist or does not have DDNS enabled. Conclusion
Saud’s Google Domains Dynamic DNS Updater bridges the gap between fluctuating residential network configurations and stable remote access. By abstracting the complexities of dual-stack IPv4/IPv6 detection into a simple, cron-ready bash script, your self-hosted web servers, VPNs, and cloud storage systems will remain securely tethered to your domain name without manual intervention.
If you need help adjusting this script for a specific provider, let me know: What domain registrar you are currently using? What operating system your home server runs on?
I can provide tailored code adjustments to match your exact environment. AI responses may include mistakes. Learn more Saved time Comprehensive Inappropriate Not working
A copy of this chat, including the images and video, will be included with your feedback A copy of this chat will be included with your feedback
Your feedback will include a copy of this chat and the image from your search
Your feedback will include a copy of this chat, any links you shared, and the image from your search.
Thanks for letting us know
Google may use account and system data to understand your feedback and improve our services, subject to our Privacy Policy and Terms of Service. For legal issues, make a legal removal request.