As follows is a quick guide on configuring your Google Domains domain(s) to be automatically updated via Dynamic DNS with ddclient.
Google Domains offers Dynamic DNS configurabilty at no additional expense, so doing this is practically a no-brainer! I’m doing this on a Raspberry Pi that also acts as my internal DNS BIND server to keep my public domains updated.
Configure Google Domains
Firstly, we need to configure your Google domain for Dynamic DNS support.
Under the DNS section of Google Domains, go to the “Synthetic Records” section.
Select “Dynamic DNS” from the left menu, enter the subdomain of your domain you want to configure for DyDNS, and press “Add.” In this example, I entered “@” because I want the top-level of my domain (rainvilletech.net itself) to be configured for DyDNS. If you wanted “random.mysite.com” to be dynamically updated, you’d enter “random” instead of “@.”
Install DDclient on Debian
Run the following:
sudo apt-get update
sudo apt-get install ddclient
Note: Leave options blank in the setup GUI that starts, we need to manually edit the configuration anyway.
Then stop the ddclient service for us to reconfigure it:
sudo systemctl stop ddclient
Edit /etc/ddclient.conf to look like the following, replacing the key portions with your values:
# Configuration file for ddclient generated by debconf
if: Enter the network interface that should be used for making connections. This is easily obtainable via “ifconfig.”
protocol=googledomains: DDclient supports this, although not listed as an option in the setup we went through at install, which is a bit misleading.
login: Enter your username, found from the Dynamic DNS synthetic record you made at the beginning.
password: Make sure this has single-quotes around it.
daemon: This is the interval of seconds between checks the server will perform to see if its IP needs updating.
use, web: This tells DDclient to obtain its own external IP via dydns.org. Remember, if you’re running NAT (which you probably are), the IP in your server’s interface is not the same as your public IP! This takes care of that.
mywebsite.com: Enter your domain here. If you’re updating the top-level of the domain like I am, omit the “@.”
In /etc/default/ddclient, find and set the following lines:
This tells ddclient to run as a daemon. Otherwise, it’ll only run once when you start it, then never again! Many guides miss this crucial step. I’ve set “daemon_interval” to 300 so the server checks for an IP update every 300 seconds (5m).
Test Configuration, Initially Update Domain, Install Service
Now it’s time to see if it works! Run the following:
sudo ddclient -daemon=0 -debug -verbose -noquiet
This runs the program in the CLI once for troubleshooting. You’ll be able to tell if it works by the output it generates. If so, check Google Domains! Your record should be updated:
Then enable ddclient and check to see if it’s running properly.
sudo systemctl enable ddclient
sudo systemctl start ddclient
sudo systemct status ddclient
You should see “active (running)” from the third command above.
Give the server a reboot to check that it still runs happily when it reboots. Maybe even take a packet capture to see your server reaching out every now and again! I used tcpdump to see the following:
That’s ddclient reaching out every five minutes to check its public IP!
Need more help? See Google’s documentation on DyDNS here.
Scott Rainville is a recent graduate of Champlain College currently working as a Cybersecurity Analyst/Engineer/purple-teamer. He loves nearly anything to do with computer networking and cybersecurity, from malware analysis to penetration testing.