Add Google Dynamic DNS to Sophos UTM

So you have a Sophos UTM device and want to setup dynamic DNS using your Google Domain? Sophos UTM offers a couple of built-in services for DynDNS, but Google Domains is not one of them. There are quite a few guides out there for hacking the UTM so that you can get this functionality, but they all seem to require creating a custom configuration file and then either manually starting the service at each boot, scheduling it to run, or something similar.

I like to make as few changes as possible. Therefore, I figured out how to modify the pre-defined services so that Google’s DynDNS server is used instead of the pre-defined server. It’s quite simple to do. Keep in mind, this change, as with most other changes, will likely get wiped out during an update, so you will likely have to re-do this at some point.

First, you need to enable SSH. You can use the ‘loginuser’ account and then su to root for this. You’ll need to know the root password as well as the loginuser password of course. You will also need to know how to use vi. If you’re not sure, I’ll provide a brief summary below the main instructions for this change.

You will also need to already have a hostname setup in Google Domains as a synthetic record using the dynamic option. You will need the credentials provided for the hostname as well.

  1. SSH into your UTM and su to root.
  2. cd /var/confd/res/dyndns
  3. vi features.ph
  4. Scroll down and look for where ‘dyndns’ is defined.
  5. modify the ‘server’ value changing the ‘members.dyndns.org’ to ‘domains.google.com’
  6. save your changes.
  7. you can logout of ssh
  8. login to the web ui and go to Network Services -> DNS -> DynDNS
  9. create a new entry using the ‘Dyn’ (or DynDNS) service.
  10. you will notice that the server displayed should be domains.google.com.
  11. select your method/interface to monitor for ip changes.
  12. enter the hostname you want to update on Google Domains.
  13. enter the username and password for your Google Dynamic DNS hostname (not your Google credentials)
  14. save the new entry and be sure to enable it
  15. after a few minutes, the status should show that it has updated. if a change was made, the hostname record in Google Domains should show the date/time that the update was made.

As promised above, if you aren’t sure how to use vi then I’ll give you a quick rundown of what you’ll need to know to make this change. Once you are in vi, just use the arrow keys to move down the screen. Once you have the cursor where you need to make a change, simply press ‘i’ to enter insert mode. Make the changes and then press ‘ESC’ to exit insert mode. Now type :wq (semi-colon, w, q) and then press enter. The semi-colon enters command mode. w tells vi to write the changes and q is of course, quit.

Leave a Reply