Dyndns

Dyndns is a free dynamic DNS service. It allows people who doesn't own a fix public IP address to be DNS resolved.
This page describe how to use ddclient to update dyndns records.

Installation

Add the package :

  • ddclient

Setup

During the installation, a set of questions are asked, if you want to redo it :

dpkg-reconfigure ddclient

The config of ddclient is stored inside /etc/ddclient.conf.

Example :

# Configuration file for ddclient generated by debconf
#
# /etc/ddclient.conf

protocol=dyndns2
use=if, if=eth0
server=members.dyndns.org
login=votrelogin
password='**********'
mx=votre.server.mx
backupmx=yes|no
wildcard=yes
monadresse.dyndns.org

Some explanation of those parameters :

  • protocol : several protocols are available, each one use specific options, see http://ddclient.sourceforge.net/?page=2
  • use : define how to get the public IP (see http://ddclient.sourceforge.net/?page=3)
    • use=if, if=eth0 use the IP of interface eth0
    • use=web, web=checkip.dyndns.com, web-skip='IP Address' get the IP from a website
  • login : dyndns account
  • password : dyndns password
  • mx (optional) : MX server
  • backupmx (optional) : if this option is enabled, the MX record will be used as a backup if the main IP is unreachable
  • wildcard (optional) : all hosts below your DNS name will be resolved with the public IP
  • Add your aliases as the send

Dyndns OVH

To use ddclient with OVH service, configure ddclient for dyndns and change this line :

server=www.ovh.com

Secure the update

The update can be done by https (version > 3.7) with the ssl option :

ssl=yes

Using a second ddclient

ddclient only allow to update one public IP. With 2 internet lines, I needed to create a second instance of ddclient.
Moreover this instance use an SNMP request on a Juniper firewall to get the IP.

The SNMP OID for the IP is .1.3.6.1.4.1.3224.9.1.1.6.5. The package “snmp” needs to be installed to get this value.

To create a second instance of ddclient, follow the steps :

  • Create a second configuration file /etc/ddclient2.conf :
# Configuration file for ddclient generated by debconf
#
# /etc/ddclient2.conf

pid=/var/run/ddclient2.pid
protocol=dyndns2
use=cmd
cmd="snmpget -Oq -Ov -v 1 -c public 192.168.10.254 .1.3.6.1.4.1.3224.9.1.1.6.5"
server=members.dyndns.org
login=votrelogin
password='**********'
wildcard=yes
mx=votre.server.mx2
backupmx=yes|no
monadresse2.dyndns.org
  • copy /etc/init.d/ddclient as /etc/init.d/ddclient2 and add it on startup :
# cd /etc/init.d
# cp ddclient ddclient2
# update-rc.d ddclient2 defaults 20
 Adding system startup for /etc/init.d/ddclient2 ...
   /etc/rc0.d/K20ddclient2 -> ../init.d/ddclient2
   /etc/rc1.d/K20ddclient2 -> ../init.d/ddclient2
   /etc/rc6.d/K20ddclient2 -> ../init.d/ddclient2
   /etc/rc2.d/S20ddclient2 -> ../init.d/ddclient2
   /etc/rc3.d/S20ddclient2 -> ../init.d/ddclient2
   /etc/rc4.d/S20ddclient2 -> ../init.d/ddclient2
   /etc/rc5.d/S20ddclient2 -> ../init.d/ddclient2
#
  • then edit /etc/init.d/ddclient2 and change the following line :
OPTIONS="-daemon $daemon_interval -syslog -file=/etc/ddclient2.conf"

To check if it's working :

/etc/init.d/ddclient2 start

Backup

  • /etc/ddclient.conf
  • /etc/ddclient2.conf
  • /etc/init.d/ddclient2

Links

en/linux/dyndns.txt · Last modified: 2011/01/09 11:59 by matthieu
Recent changes RSS feed Debian Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki