Configuring EasyDNS dynamic DNS updating on asuswrt-merlin router firmware
As part of switching from AT&T to Comcast I decided to upgrade my router. Since I was already using an older Asus router running Tomato firmware I opted for the Asus RT-AC68U. And rather than flashing Tomato on it I decided to try asuswrt-merlin which is basically the stock Asus firmware with bug fixes and some useful enhancements.
One of the useful enhancements is support for custom scripts to deal with situations the GUI doesn’t handle. One such situation is if your dynamic DNS service isn’t supported by the firmware. In my case that is EasyDNS.
Since the wiki article on writing a custom DDNS script didn’t include an example for EasyDNS I decided to document my solution in this article. Per the asuswrt-merlin documentation the following script needs to be placed in /jffs/scripts/ddns-start
:
#!/bin/sh # # This script provides dynamic DNS update support for the EasyDNS service on # the Merlin asuswrt router firmware. # # This script takes one argument: the WAN IPv4 address. # It should be installed as /jffs/scripts/ddns-start. # # See https://github.com/RMerl/asuswrt-merlin/wiki/Custom-DDNS for more # information about the context for this script. date >> /tmp/ddns-start.log echo "$#: $*" >> /tmp/ddns-start.log # This should be the domain (or hostname) to be updated. DOMAIN='Your-Domain-Name-Here' # This should be your EasyDNS user name and the update token obtained from # EasyDNS. EASYDNS_USERNAME='Your-Username-Here' EASYDNS_PASSWORD='Your-EasyDNS-DDNS-Update-Token-Here' # Set wildcard "on" if you want this to map any host under your domain # to the new IP address otherwise "off". WILDCARD=off URI_BASE='https://members.easydns.com/dyn/dyndns.php' WAN_IP=$1 curl --silent --user "$EASYDNS_USERNAME:$EASYDNS_PASSWORD" \ "$URI_BASE?wildcard=$WILDCARD;hostname=$DOMAIN;myip=$WAN_IP" \ > /dev/null 2>&1 if [ $? -eq 0 ]; then /sbin/ddns_custom_updated 1 else /sbin/ddns_custom_updated 0 fi
The next challenge is figuring out how to setup and maintain a AAAA DNS record that maps the IPv6 address for my Mac Pro server to a public host name.