Skip to content

Instantly share code, notes, and snippets.

@mrprompt
Last active May 15, 2018 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrprompt/65fbdd2135a2c5b2bebbfd2e9ffef69b to your computer and use it in GitHub Desktop.
Save mrprompt/65fbdd2135a2c5b2bebbfd2e9ffef69b to your computer and use it in GitHub Desktop.
Automatic update configuration for dyndns

Automatic update configuration for dyndns

Get dynamic DNS account

DLink offers free dyn.com dynamic DNS accounts for any user for a single hostname on dlinkddns.com domain (it's still possible to get a similar account directly from dyn, but more complex). Create the account and the host on https://www.dlinkddns.com/login.

Hostname : xxxxx.dlinkddns.com username : dlinkusername password ! dlinkpassword

Download ddclient

Recommended Linux dyn.com client id ddclient on http://sourceforge.net/p/ddclient/wiki/Home/

 wget http://cdn.dyndns.com/ddclient.tar.gz
 tar -xvf ddclient.tar.gz
 cd ddclient-3.7.3/

Installation

sudo cp ddclient /usr/sbin/
sudo mkdir /etc/ddclient
sudo cp sample-etc_ddclient.conf /etc/ddclient/ddclient.conf

Edit configuration (see below)

sudo nano /etc/ddclient/ddclient.conf 

Test the client manually and check the address is updated on dlinkddns.com

sudo /usr/sbin/ddclient

Install as a service (missing LSB warning can be ignored...)

sudo cp sample-etc_rc.d_init.d_ddclient.ubuntu /etc/init.d/ddclient
sudo update-rc.d ddclient defaults

Update the startup file to add verbose logging to syslog

sudo nano /etc/init.d/ddclient

Change the start line

start-stop-daemon -S -q -p $PIDFILE -x $DDCLIENT -- $DELAY

To

start-stop-daemon -S -q -p $PIDFILE -x $DDCLIENT -- $DELAY -verbose -syslog

Start the first time by hand

sudo service ddclient start

Check the ddclient process is running and the update was done in the log

tail /var/log/syslog
Feb nn nn:07:52 name ddclient[6251]: RECEIVE:  <html><head><title>Current IP C
heck</title></head><body>Current IP Address: nn.nn.nn.nn</body></html>#015
Feb nn nn:07:52 name ddclient[6251]: SUCCESS:  xxxxxxx.dlinkddns.com: skipped:
 IP address was already set to nn.nn.nn.nn.

Configuration

Content of etc/ddclient/ddclient.conf.

  • deamon is the refresh rate 600 = every 5mn
  • login and password need to be changed to the dlinkddns site accoutn created previously
  • the last line contains the host address created at dlinkddns
daemon=600
cache=/tmp/ddclient.cache
pid=/var/run/ddclient.pid
use=web, web=checkip.dyndns.com/, web-skip='IP Address'
login=dlinkusername
password=dlinkpassword
protocol=dyndns2
server=members.dyndns.org xxxxxxxx.dlinkddns.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment