OpenWrt logo

This is an implemention in linux shell script of "The Original Direct TCP Connection Protocol" part of GnuDIP Client-Server Update Protocol to "request that the server determine the IP address it sees at the client end of the connection". To use this manual you need to register your domain name with a GNUdip compatible dynamic DNS provider like dynu.com.

To update the IP address in DNS execute this command:

nc gnudip.dynu.com 3495 -e gnudip.sh

The nc command is part of busybox in an OpenWrt environment but it may work with any netcat implementation, although the syntax may vary.

In gnudip.sh is where the magic happens. After connecting the server sends the "salt" string. This is received by the read command and stored in the $salt variable. The password is MD5 coded by the md5sum command, also part of busybox.

The trailing '-' sign meaning standard input is removed by: sed 's, .*,,'

The salt value is appended and the resulting string is MD5 coded again. The trailing '-' sign is removed again as described in the previous paragraph.

The update message character string is now completed like this:

user_name:hashed_password:domain:2

This string is transmitted to the server with a simple echo command.

The server then responds with a '0' if everything was OK. This is received by the read command and stored in the $resp variable to be evaluated.

UPDATE 1: This method stopped working with dynu.com somewhere mid 2020. After connecting to the server apart from the salt a '1' was returned straight away indicating an error.

Don't panic however. The gnudiphttp.sh linux shell script implements "The HTTP Based Protocol" part of GnuDIP Client-Server Update Protocol. Here first an update request is issued and then confirmed by sending the correct parameters, e.g. the username and hashed password.

This script may be easier to use as it doesn't depend on a particular netcat implementation. Only a simple wget is needed. If you decide to use it don't forget to replace ********** with your username and password respectively.

UPDATE 2: As OpenWrt LuCI ddns service uses the easier IP address update API, I'll be using that instead.