Dynamic DNS with Google Domains

Google Domains has been a great place to manage all of my registered domains names. While there are several well-established free and paid dynamic dns services — of some which require technical knowledge or complicated setup — Google Domains supports dynamic dns natively and easily (and for free) using either a dedicated API or standards-based integration to open tools like ddclient or in-a-dyn.

Objective

In this article, you will learn how to setup dynamic DNS on any device in your home network using ddclient and Google Domains.

Configure Google Domains

We’ll assume that you’ve already registered a domain name that is hosted using Google Domains. We’ll start by creating a Synthetic Record for the domain name that we’ll assign our device and then configure the record to accept input when the public IP Address of our device changes.

Create a Synthetic Record

Sign in to Google Domains and select the name of your domain. In the left menu, select DNS.

Screenshot of the left navigation menu in Google Domains showing “DNS” selected.

In the right pane, scroll down to Synthetic Records and select type Dynamic DNS in the drop-down box. Enter the subdomain that you will assign to your device. In this example, we’ll use the subdomain medium. Click Add.

Screenshot showing the Synthetic Record creation menu in Google Domains for type Dynamic DNS with a subdomain of “medium”.

The Dynamic DNS record has been created, but we’ll need to get the credentials from this record to use with ddclient. Click the expand triangle next to the record that we just created to view its values.

Expanded view of Dynamic DNS settings for medium.technolofree.com showing link to view credentials that will be needed to ddclient configuration.

Click View credentials to see the values for the username and password that we’ll need to configure ddclient on our local device. Leave this tab open which we configure ddclient.

Install and Configure ddclient

Start by selecting an always-on device on your network where you will install ddclient to process updates to your Dynamic DNS record. In my case, I will be using a Raspberry Pi that also serves as my VPN gateway which allows me to access my home network remotely.

Install ddclient

In this example, we will install ddclient on a Raspberry Pi running Raspberry Pi OS (previously called Raspbian). You can run ddclient on a number of different devices and operating systems, but for this example we’ll provide instructions for Raspberry Pi OS.

Issue the following command to update your package repos and install ddclient (if it’s not already installed).

sudo apt update && sudo apt install ddclient

Configure ddclient

Configuring ddclient is super simple and only requires copy/paste of a few lines. Using your favorite text editor, we’ll edit /etc/ddclient.conf

Although version 3.9 and up of ddclient has built-in Google Domains support, the version that is currently available for Raspberry Pi (3.8.x) does not :(. But that’s OK! We can also use the dyndns2 protocol with Google Domains!! We’ll review both methods and start by pasting the example configurations from the Google Domains Dynamic DNS help page.

Option 1: googledomains native protocol

ssl=yesprotocol=googledomainslogin=generated_usernamepassword=generated_passwordyour_resource.your_domain.tld

Lines 1 & 2 will remain unchanged and tell ddclient to 1) encrypt communication with SSL, and 2)use the built-in “googledomains” protocol.

For lines 3 & 4, remove all text after the “=” (equal sign) and replace with the values in the Google Domains tab that we left open when we clicked “View credentials”.

Finally, for line 5, replace the entire line with the full domain name of the Synthetic Record that we just created. In my case, medium.technolofree.com

Pro Tip: Don’t forget the single quotes around the password.

The resulting ddclient.conf file looks like this for me (never share your login or password values)

ssl=yes
protocol=googledomains
login='notmyrealUsername'
password='notmyrealPassword'
medium.technolofree.com

Option 2: dyndns2 protocol

protocol=dyndns2use=webserver=domains.google.comssl=yeslogin=generated_usernamepassword=generated_passwordyour_resource.your_domain.tld

Lines 1–4 will remain unchanged and tell ddclient to 1) use the dyndns2 protocol, 2) use the web method, 3) use the specified server to obtain the public IP address, and 4)encrypt communication with SSL.

For lines 5 & 6, remove all text after the “=” (equal sign) and replace with the values in the Google Domains tab that we left open when we clicked “View credentials”.

Finally, for line 7, replace the entire line with the full domain name of the Synthetic Record that we just created. In my case, medium.technolofree.com

Pro Tip: Don’t forget the single quotes around the login and password.

The resulting ddclient.conf file looks like this for me (never share your login or password values)

protocol=dyndns2
use=web
server=domains.google.com
ssl=yes
login='notmyrealUsername'
password='notmyrealPassword'
medium.technolofree.com

Restart ddclient

Save the file and restart ddclient. To restart ddclient on Raspberry Pi OS, issue the following command:

sudo service ddclient restart

Confirm that everything is working

Go back to your Google Domains tab and refresh the page. Scroll down to the Synthetic Record we previously created, expand and review the status.

Expanded view of Dynamic DNS settings for medium.technolofree.com showing updated information after ddclient has been configured.

The Synthetic Record should now show a Last Modified date and time as well as the Public IP Address of the updated DDNS record (Data).

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store