Netgear DG834GT DynDns Work Arounds for Static DNS and Custom DNS

Home

Update

I have been informed that the solution presented is also applicable for the Netgear DG834PN (Thanks "Ma" - 21 May 2007)

Disclaimer

Use the information on this page at your own risk. I take no responsibility for any damage caused by using the instructions on this page. That being said, I hope you have the same success that I have had.

Problem

The DG834GT ADSL Router [1] will only update Dynamic DNS host entries from a DynDNS [2] account. This is problematic for people who have Static or Custom DNS hosts that need updating, like myself.

The problem

Investigation

Firstly, I should mention that I am using the latest firmwire available at the time of writing this which is Version 1.02.04 [3].

DynDNS.org

The problem lies in the fact that the "system" parameter of the update syntax [4] sent to the DynDNS.org servers is optional and by default set to "dyndns" as seen below;
system=dyndns|statdns|custom The system you wish to use for this update. DynDNS will update a Dynamic DNS hostname, custom will update a Custom DNS hostname, while statdns will update a Static DNS hostname. If the system parameter given is not dyndns, custom or statdns the update will fail. If the system parameter is not specified at all, it will default to dyndns. Systems: All, Optional: Yes
Therefore attempt #1 is to try and explicitly include either "system=custom" or "system=static" parameter within the update request. Since no checks are performed on the input fields and given that DynDNS update requests are transmitted using HTTP, we try augmenting "Host Name" as follows:
test4.customtest.dyndns.org&system=custom
Unfortunately, no luck with this. You do however get a nice cryptic error message of "WAN IP address is NULL".

Router "Hackability"

In my journey for exploring alternative methods I came across several interesting articles [5][6][7] detailing hacks / mods succesfully performed on the predecessors of my router; the DG834 [8] / DG834G [9]. Very cool indeed. I was keen to find out if the same was true with my router model.

Firstly, we active debug mode and thus start a telnet daemon;
http://192.168.0.1/setup.cgi?todo=debug
Then get a shell terminal up and running;
$ telnet 192.168.0.1 Trying 192.168.0.1... Connected to 192.168.0.1. Escape character is '^]'. BusyBox v1.00 (2005.07.29-07:22+0000) Built-in shell (ash) Enter 'help' for a list of built-in commands. #
Awesome!!! After some searching I found the "script" called to update the DynDNS record within the cron table;
# cd /etc/ # cat crontab SHELL=/bin/sh PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin MAILTO=root HOME=/ TZ=GMT-10 0 12 * * * root /usr/sbin/rc ddns start # firewall schedule set to always 0 * * * * root killall -1 syslogd #
Unfortunately "rc" is an executable and as such we can't quickly determine what it is that it actually does. Supprisingly it would appear that this script is scheduled to run everyday at midday. Considering Dynamic DNS entries don't expire for 28 days this seems like massive overkill assuming the script gets executed explicitly when the WAN IP address changes. Given this setting was defined by the hardware vendor we can assume that any problems / violations of the Acceptable Use Policy exist between Netgear and DynDNS.

Explictly running the script using one of the DynDNS Dynamic DNS test accounts results in a sucessfull update (actual update is done when we click "Apply" in the Web UI):
Host Name: test.ath.cx
# rc ddns start ap_name=ddns action=start killall: /usr/sbin/ez-ipupdate: no process killed ez-ipupdate Version 3.0.11b8 Copyright (C) 1998-2001 Angus Mackay. no update needed at this time #
As can be seen, the rc script internally makes use of the ez-ipupdate DynDNS client update software [10]. Of interest is the fact that the version suceeds any thing available off the authors website (most recent version is Version 3.0.11b7). Re-trying with parameters specified in attempt #1 produces the following mess;
Host Name: test4.customtest.dyndns.org&system=custom
# rc ddns start ap_name=ddns action=start killall: /usr/sbin/ez-ipupdate: no process killed ez-ipupdate Version 3.0.11b8 Copyright (C) 1998-2001 Angus Mackay. sh: -i: not found ioctl(SIOCGIFADDR): No such device interface: #
the "sh: -i: not found" now identifies the source of attempt #1's failure: the ampersand. The ampersand is being interpretted by the shell and causes the ez-ipupdate command to run, incomplete, in the background. The simple solution is to escape the ampersand so its ignored by the shell.
Host Name: test4.customtest.dyndns.org\&system=custom
# rc ddns start ap_name=ddns action=start killall: /usr/sbin/ez-ipupdate: no process killed ez-ipupdate Version 3.0.11b8 Copyright (C) 1998-2001 Angus Mackay. no update needed at this time #
Success!!! A quick validation is performed by pinging the host which correctly corresponds to my WAN IP.

ez-ipupdate

Given we are just executing ez-ipupdate, what else can we do with it? Firstly, we can define the "system" parameter via the "-S" argument [11] producing the following:
Host Name: test4.customtest.dyndns.org -S dyndns-custom
# rc ddns start ap_name=ddns action=start killall: /usr/sbin/ez-ipupdate: no process killed ez-ipupdate Version 3.0.11b8 Copyright (C) 1998-2001 Angus Mackay. no update needed at this time #
Success!!! Does that also mean we can use other Service Providers as supported by ez-ipupdate?
# ez-ipupdate -S dyns unknown service type: dyns try one of: null dyndns dyndns-static dyndns-custom #
No. Oh well... At least the services of DynDNS can be fully utilized.

Solution

Therefore two solutions have been found which solve the stated problem.

Method 1

Augment the hostname with the "system" parameter interpreted by the DynDNS.org update system. Specifically;
test4.customtest.dyndns.org\&system=custom or test-static.ath.cx\&system=statdns
The first solution should work regardless of the version of ez-ipupdate as it is handled by DynDNS themselves.

Method 2

Supply the service type to the ez-ipupdate program explicitly. Specifically,
test4.customtest.dyndns.org -S dyndns-custom or test-static.ath.cx -S dyndns-static
The second method produces the same result in the end - it looks marginally more readable. Additionally, other options [11] could in theory be passed (if not already defined by "rc") for further control over the record.

Have fun.

References

  1. "Netgear DG834GT 108Mbps Super Wireless ADSL Router with 4-Port 10/100 Switch" http://www.netgear.com/products/details/DG834GT.php
  2. "DynDNS.org" http://www.dyndns.org
  3. "DG834GT Version 1.02.04 Firmware http://kbserver.netgear.com/release_notes/D102796.asp
  4. "DynDNS Update Syntax" http://www.dyndns.com/developers/specs/syntax.html
  5. "The DG834 Hacking Site" http://dg834.grandou.net/
  6. "The Little DG834G Page" http://www.suburbia.com.au/~dan/
  7. "The Netgear DG834 / DG834G Mod Thread" http://forums.whirlpool.net.au/forum-replies.cfm?t=160805
  8. "Netgear DG834 ADSL Firewall Router" http://www.netgear.com/products/details/DG834.php
  9. "Netgear DG834G 54 Mbps Wireless ADSL Firewall Router http://www.netgear.com/products/details/DG834G.php
  10. "ez-ipupdate" http://ez-ipupdate.com/
  11. "ez-ipupdate - ez-dynamic DNS client Linux Man Page" http://linux.com.hk/penguin/man/8/ez-ipupdate.html

Last updated: 21st May 2007