In latest version of their airOS firmware for airMax devices Ubiquiti networks dropped support for Dynamic DNS services. This left me out in the dark, unable to update the dynamic DNS corresponding to my devices. After a lot of crawling around the support forums I eventually came to a working solution based on crontab.

I use services from Hurricane Electric for my dynamic DNS needs. Updating boils down to fetching a special URL using either wget or curl. My idea was to do this every 30 minutes using cron jobs. This would have been done within a couple of minutes on a regular Linux system but turned out to be less straight forward on Ubiquiti device.

The airOS system ships with crond, however it is looking for its crontabs files into /etc/crontabs and it is not started on boot. What we will do is create custom scripts to run crond on boot and use our own crontabs directory.


  • An airMAX Ubiquiti device running a Custom Scripts capable firmware. Get it from here. I am using version 8.7.1
  • SSH access to the device
  • Know-how on editing files using vi editor (there are plenty of vi tutorials on the internet)
  • Familiar with cron jobs

Getting it done

Create or edit the poststart script using vi editor. This script will be run after the system has started.

vi /etc/persistent/rc.poststart

Below is the content of the rc.poststart script. It basically only starts crond telling it to look into our own (not yet created) crontabs directory.

#!/bin/sh /bin/crond -b -c /etc/persistent/crontabs -L /dev/null
Code language: JavaScript (javascript)

Make the rc.poststart script executable and create the directory where our crontabs will be stored.

chmod +x /etc/persistent/rc.poststart mkdir /etc/persistent/crontabs

Edit our cronjobs

crontab -e -c /etc/persistent/crontabs

This is how my cron job to update my dns looks like (it is anonymized here).

*/30 * * * * /bin/wget -O /tmp/updatednsresponse.txt > /tmp/updatedns.log 2>&1
Code language: JavaScript (javascript)

Save everything between reboots !

Once done and on every change, in order to apply your changes you need run the following commands. This will save the changes (actually all that is contained in /etc/persistent plus other config stuff) and reboot the system.

save reboot


Here are the partial information (not exhaustive list) I collected to achieve this :

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.