How To Set Up Dynamic DNS Using Google Domains and Ubuntu Server | The Chris and Andre Show (2024)

Dynamic DNS is a service that allows you to point your domain name at a dynamic IP address. This means that the IP address of your website changes periodically.

Google Domains offers Dynamic DNS for free with all domain purchases. You can set up Dynamic DNS using Google Domains and Ubuntu Server in under an hour.

This tutorial will show you how to set up Dynamic DNS using Google Domains and Ubuntu Server.

Table of Contents

  • Why Use Dynamic DNS?
  • What is Google Domains?
  • Step 1: Setup Dynamic DNS in Google Domains
  • Step 2: Setup DDClient
  • Step 3: Configure Your Web Server

Why Use Dynamic DNS?

Dynamic DNS is a service that allows a user to change their IP address without having to constantly update the IP address on their devices. This makes it much easier than before to make an IP address accessible from anywhere, which is useful for people who work remotely and need a reliable connection that is always available.

It is also important to note that Dynamic DNS does not require any client-side configuration. The Dynamic DNS service does all of the work for you.

What is Google Domains?

Google Domains is a domain registrar that provides users with the opportunity to register their own domain name.

Google Domains offers you the chance to get your own domain name without having to go through a third party. It also provides you with the ability to use your own personal email address, which is linked directly to your website or blog.

Benefits of Google Domains

The benefits of Google Domains are that it offers a simple interface, easy-to-use tools, and low pricing. You receive a lot of control of your domain compared to the pricing of other services like DynDNS ($24.95 a year at the time of writing) with limited features. There are free services like noip.com, but you have little no control of the domain name used and may have to verify usage every 30 days.

Google Domains provides you with a personal dashboard with all your domains, emails, and contacts. You also get Google apps integration, so you can access all your email, calendar and chat from one place.

Environment

  • Ubuntu 18.04 LTS I am sure this will work on later versions, but my production servers on DigitalOcean all run this version.
  • Apache 2
  • ddclient 3.8.3 - Installation
  • certbot 0.27.0 - Installation

Step 1: Setup Dynamic DNS in Google Domains

  1. Sign in to Google Domains.
  2. Select the name of your domain.
  3. Select 'DNS' on the left side of the screen. Default name servers must be active or this will not work.
  4. Click Show advanced settings.
  5. Click Manage dynamic DNS and Create new record.
  6. Assign a Dynamic IP by entering the name of the subdomain or root domain.
  7. Click Save.

When you get to step 4 of 'Setting up a Dynamic synthetic record' if you want to add multiple sub-domains, this is the first change to make. Since sometimes I may share access to a finished product of something adding '@' ("root domain" or "naked domain") is the way to go. If not, add the sub-domain of your choice.

How To Set Up Dynamic DNS Using Google Domains and Ubuntu Server | The Chris and Andre Show (1)

Something I considered is I can always forward a unique sub-domain,like GitHub Pages, if needed to later on. On my web server, my config files control the direction of the request. So having traffic go to the root domain location makes the most sense for me.

How To Set Up Dynamic DNS Using Google Domains and Ubuntu Server | The Chris and Andre Show (2)

Complete the rest of the steps in the instructions.

Step 2: Setup DDClient

Dynamic Domain Name System is a service that automatically updates the IP address associated with a domain name, which can be useful for accessing a website that is using a dynamic IP address (e.g., for web hosting services) on the Internet. This service can be provided by DDclient, which is software that updates the computer records of domain names to reflect changes in their IP addresses.

I could not get ddclient to function correctly using the built in Google Domains support, so I opted for the instructions without Google Domains support.

# Configuration file for ddclient generated by debconf## /etc/ddclient.confdaemon=300protocol=dyndns2use=webserver=domains.google.comssl=yeslogin=generated_usernamepassword='generated_password' # see the Note below@.your_domain.tld

Test your configuration:

Note: If you are experiencing issues here you may need to remove the single quotes

sudo ddclient -daemon=0 -debug -verbose -noquiet

You have completed the setup correctly if the output ends with "SUCCESS" - the output should be similar to:

SUCCESS: @.yourdomain.com: skipped: IP address was already set to 12.80.274.74.

I then made sure that the URLS have propagated. Once the main URL is successful (also check with www.yourdomain.com) I then checked with random sub-domains with and without www pre-pended. After I felt good about the results, I moved to the next step.

Step 3: Configure Your Web Server

The domain that I selected ends in page so I had to have a secure connection in order for my URLS to function correctly. I won't tell you how long it took me to figure this out, but that is why these steps are next ;-). With using the default .conf file I was ready to begin.

Repeat this process with each site/domain that you are setting up to use with your Dynamic DNS.

Copy a clean conf file:

sudo cp 000-default.conf DOMAIN_NAME.conf

Adjust file to serve the domain that it will serve:

<VirtualHost *:80>ServerAdmin your_email@yourdomain.comServerName sub-domain.yourdomain.comServerAlias www.sub-domain.yourdomain.comDocumentRoot /var/www/sub_domainErrorLog ${APACHE_LOG_DIR}/error.logCustomLog ${APACHE_LOG_DIR}/access.log combined</VirtualHost>

If You Need A Redirect

I mentioned my comic book server and of course I needed to access it with my new domain structure. So here is an example of how I added a virtual host on my server to make that a reality.

<VirtualHost *:80>ServerAdmin your_email@yourdomain.comServerName sub-domain.yourdomain.comServerAlias www.sub-domain.yourdomain.comDocumentRoot /var/www/sub_domainErrorLog ${APACHE_LOG_DIR}/error.logCustomLog ${APACHE_LOG_DIR}/access.log combined<Location /> ProxyPass http://192.168.1.76:2202/ ProxyPassReverse http://192.168.1.76:2022/</Location><Location /admin> ProxyPass http://192.168.1.76:2203/admin ProxyPassReverse http://192.168.1.76:2203/admin </Location></VirtualHost>

Activate the site to be used:

sudo a2ensite DOMAIN_CONF.conf

Generate An SSL Certificate Using Certbot - Optional, Not Optional

I would recommend that you redirect all connections to a secure connection.

sudo certbot --apache -d nextcloud.yourdomain.com -d www.nextcloud.yourdomain.com

Your .conf file will look like the following and it will create a secure connection .conf file automatically.

<VirtualHost *:80>ServerAdmin your_email@gmail.comServerName sub-domain.yourdomain.comServerAlias www.sub-domain.yourdomain.comDocumentRoot /var/www/sub_domainErrorLog ${APACHE_LOG_DIR}/error.logCustomLog ${APACHE_LOG_DIR}/access.log combinedRewriteEngine onRewriteCond %{SERVER_NAME} =sub-domain.yourdomain.com [OR]RewriteCond %{SERVER_NAME} =www.sub-domain.yourdomain.comRewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]</VirtualHost>

That's it, open your browser and go to the desired URL and you will see the site you are looking for. Let us know if you have tried this out and if it works for you.

How To Set Up Dynamic DNS Using Google Domains and Ubuntu Server | The Chris and Andre Show (2024)

FAQs

How to set up Google DNS in Ubuntu? ›

Select your active internet connection (Wi-Fi if wireless, or Ethernet if you're computer is hardwired) and then click the Edit button. Once you've entered the DNS information, click on the Save button to save the settings. You will need to reconnect your network for the settings to take affect.

Does Google domains have DDNS? ›

The End of DDNS Support at Google Domains

Squarespace's decision to discontinue DDNS support for domains purchased through Google Domains may have left some users wondering about the stability and accessibility of their online presence.

What are the requirements for Dynamic DNS? ›

Dynamic DNS requirements. To take advantage of DDNS, you need three things: A private WAN IP, a Dynamic DNS service, and a DDNS updater device.

What is a Dynamic DNS with a domain name? ›

Dynamic DNS (DDNS) is a service that can automatically update DNS records when an IP address changes. Domain names convert network IP addresses to human-readable names for recognition and ease of use. The information mapping the name to the IP address is recorded tabularly on the DNS server.

How do I know if my Dynamic DNS is working? ›

After DDNS is enabled, you can confirm it is working by performing a DNS query for the MX DDNS hostname. Open a command prompt on any workstation and type "nslookup <your dynamic DNS name>." The DNS response should return the current active public IP address of the MX.

Is Google Dynamic DNS free? ›

Dynamic DNS is a service that allows you to point your domain name at a dynamic IP address. This means that the IP address of your website changes periodically. Google Domains offers Dynamic DNS for free with all domain purchases.

What is the URL for Google DDNS update? ›

The update URL should be https://[USERNAME]:[PASSWORD]@domains.google.com/nic/update?hostname=[DOMAIN]&myip=[IP] .

How do I change my DNS from static to dynamic? ›

Click Start, point to Administrative Tools, and then click DHCP. Right-click the appropriate DHCP server or scope, and then click Properties. Click DNS. Click to select the Enable DNS dynamic updates according to the settings below check box to enable DNS dynamic update for clients that support dynamic update.

What is Dynamic DNS for owned domain? ›

DynDNS or "Dynamic Domain Name Service" is a service that makes it possible to set up a fixed domain name for a changing IP address. With Dynamic DNS (DynDNS), you have the ability to forward your registered domains and set up sub-domains at STRATO to any computer connected to the internet.

Is Dynamic DNS free? ›

After the 7-day trial, you will be charged just $55/year to keep your Dynamic DNS service. Only valid major credit cards (not PayPal) are accepted for Dynamic DNS trials.

Top Articles
Latest Posts
Article information

Author: Edwin Metz

Last Updated:

Views: 6305

Rating: 4.8 / 5 (58 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Edwin Metz

Birthday: 1997-04-16

Address: 51593 Leanne Light, Kuphalmouth, DE 50012-5183

Phone: +639107620957

Job: Corporate Banking Technician

Hobby: Reading, scrapbook, role-playing games, Fishing, Fishing, Scuba diving, Beekeeping

Introduction: My name is Edwin Metz, I am a fair, energetic, helpful, brave, outstanding, nice, helpful person who loves writing and wants to share my knowledge and understanding with you.