How to use Google Cloud with TokenDNS

When you are using the Google Cloud Platform, you want to automate as much as possible. We want to help!

Starting a new machine in GCE is not a difficult thing and luckily it’s possible to supply a startup script and some metadata to automate the registration of the new machine with TokenDNS.

Configure Startup Script

We need to use a little helper script to make the dns registration. Don’t worry we published it on github.com for you to grab. The register_tokendns.sh script will get executed when the VM starts and use some metadata information that we configured to register it with TokenDNS.
Copy the content of the register_tokendns.sh script and paste it in the Startup Script section when you add a new virtual machine.

Add Metadata

The metadata that we configure are apikey and domain. These are necessary information that you need to provide, otherwise the registration will fail. It would be possible to extend the script to add e.g. tags.

Lets have a look at the Console in the Google Cloud how it should look:

If you want to learn more about GCE and Startup scripts you can look here. They even tell you how to use the CLI and scripts 😉

Leave a Reply

Your email address will not be published. Required fields are marked *