In addition to this domain, I had a couple others languishing at the somewhat skeevy I’d configured them to redirect to a pair of Medium publications, back when Medium was offering free SSL certificates for custom domains on their site.

I also had an obsolete Lenovo laptop running Linux, with Verizon Fios internet service, pointed to by a a DDNS name from I’d been using it for hobby-grade stuff, but the lack of HTTPS was going to be a problem.

But thanks to this article from Jeremy Gale I was able to redirect my two domains to my on-prem Ubuntu server, set up a number of subdomains, and obtain free SSL certificates for everything.

Here’s a short recap of what I did.

Domain transfer from Godaddy to Google Domains

At you can easily initiate a domain transfer. The site walks you through the process, transfers any custom DNS settings, and credits you for remaining time from Cost is $12 per domain for the transfer, and $12 for renewals thereafter.

Configure DDNS

Within the DNS Settings, create a Synthetic Record of type DDNS. Don’t bother setting the IP address – that is set by this script, run from the host, that uses Google Domains API.

### Google Domains provides an API to update a DNS
### "Synthetic record". This script updates a record with 
### the script-runner's public IP address, as resolved using a DNS
### lookup.
### Google Dynamic DNS:
### Synthetic Records:


# Resolve current public IP
IP=$( dig +short )
# Update Google DNS Record
curl -s $URL

Set up subdomains

I’m interested in a few subdomains for various projects – you can easily set those up by adding Custom resource records of type CNAME:


For example, after working through the Angular Tour of Heroes project, I decided to deploy it to

Configure nginx server block for each domain

Because I had two domains, but only one host, I was pleased to find this post on configuring multiple domains with Nginx on Ubuntu.

The short story is you simply create a server directive block for each domain or subdomain, specifying the location of the files to serve.

server {
     listen 80;
     listen [::]:80;

     root /var/www/;

     index index.html index.htm;

     location / {
          try_files $uri $uri/ =404;

Use certbot and LetsEncrypt to generate and install certificates

Certificates? That turned out to be the easiest of all. Simply head to and follow the instructions.

sudo certbot --nginx

Automatically analyzes your Nginx configuration and requests, then installs the reqired certificate. Once you’ve verified that it works

$ certbot renew --dry-run

Add this to your crontab to auto-renew the certificates:

18 4 * * * /usr/local/bin/certbot renew