Pseudo-ALIAS with Google Domains DNS

the setup

The now alias command allows you to alias any deployment to one of your custom domain names. For example, when I aliased this Ghost deployment to my domain name, I ran:

$ now alias set
> is a custom domain.
> Verifying the DNS settings for (see for help)
> Verification OK!
> Success! Alias created (ABCCAwOwoYnMdt0A2APPUXyZ): now points to (aBCMRT3LQqqS4X33QMYDJxyz)

In order for this to work, you must configure your domain's DNS records to point to the nameservers.

the problem

The problem was that I was using Google Domains for DNS management to leverage dynamic DNS records and Google Apps MX records, so I couldn't simply point the NS record and call it a day.

I wanted my root domain name ( to resolve to the servers so that now alias would work as expected, but retain other records like my MX mail record and my wildcard CNAME record resolving to the root domain (so that will resolve to, which ultimately will resolve to the Zeit servers).

the solution

Some DNS providers support what's called an ALIAS DNS record, which is like a top-level A record that can point to a hostname address that can be dynamically updated (similar to a CNAME record for subdomains).

If your DNS provider supports ALIAS records, then simply create one and point it to "" and you're done!

Google, however, does not support this record type…

Fortunately they do support what's called "Dynamic DNS", which in short means that you can programmatically update the IP address that this particular dynamic DNS record points to.

In the Google Domains "Configure DNS" area, add a new "Dynamic DNS" record pointing to the root of the domain name. To do this, specify an @ character as the name of the record. Then hit the "Add" button to create the new record.

Expand the dropdown on your new synthetic record and find the "View Credentials" link. Click on it and copy down the username and password that were generated on your behalf. These credentials will be used in just a moment.

Now we need a script that will update this dynamic DNS record to point to the domain name on a periodic interval (typical ALIAS records update every 5 minutes). I've written such a script:

See the usage instructions inside the script. You need to specify the USERNAME, PASSWORD, HOST and TARGET as env variables for the script to operate properly. Invoking the script a single time will attempt to update the Dynamic DNS record to match what TARGET is resolving to.

At this point, you can stick this script in a cronjob on Linux / a Timed Job on MacOS that runs every 5 minutes. Add the following to your crontab file (run crontab -e to edit):

*/5 * * * * USERNAME=___ PASSWORD=___ HOST=___ TARGET=___ /path/to/

Fill in the blanks, and we're done!

At this point your dynamic DNS record (HOST) will be updated to point to the TARGET domain name every 5 minutes. Yay automation!