본문 바로가기
네트워크 (LAN,WAN)

Using ddclient With DynDNS.com Services

by 날으는물고기 2009. 6. 10.

Using ddclient With DynDNS.com Services

ddclient is a Perl based client used to update DNS entries. This client works with all of our services as well as services provided by many of our competitors. ddclient was originally written by Paul Burry and is now maintained by a group of developers via a sourceforge project.

Acknowledgment: Much of the info in the KB article is extracted from the ddclient home page.

Download: The most recent version of ddclient should always be available here.

INSTALLATION:

  cp ddclient /usr/sbin/
  mkdir /etc/ddclient
  cp sample-etc_ddclient.conf /etc/ddclient/ddclient.conf
  vi /etc/ddclient/ddclient.conf
  -- and change hostnames, logins, and passwords appropriately

  ## For those using Redhat style rc files and using daemon-mode:
  cp sample-etc_rc.d_init.d_ddclient /etc/rc.d/init.d/ddclient
  ## enable automatic startup when booting
  /sbin/chkconfig --add ddclient
  ## start the first time by hand
  /etc/rc.d/init.d/ddclient start

  ## If you are not using daemon-mode, configure cron and dhcp or ppp
  ## as described below.

 svn co https://svn.sourceforge.net/svnroot/ddclient/trunk/svn ddclient

There are a few configuration examples provided which you can copy to /etc/ddclient/ddclient.conf and modify. More info about the configuration can be found on the usage page. There's also a sample configuration delivered with ddclient.

A typical configuration like:

#
# /etc/ddclient/ddclient.conf
#
protocol=dyndns2
use=web
login=mylogin
password=mypassword
myhost.dyndns.org

You can run ddclient as "/usr/sbin/ddclient -daemon 300 -syslog" and put it in your startup scripts. There are samples of startup scripts provided with ddclient. 


TROUBLESHOOTING:

  1. enable debugging and verbose messages.
        $ ddclient -daemon=0 -debug -verbose -noquiet

  2. Do you need to specify a proxy?
     If so, just add a
        proxy=your.isp.proxy
     to the ddclient.conf file.

  3. Define the IP address of your router with fw=xxx.xxx.xxx.xxx in
     /etc/ddclient/ddclient.conf and then try
        $ ddclient -daemon=0 -query
     to see if the router status web page can be understood.

  4. Need support for another router/firewall?
     Define the router status page yourself with:
        fw=url-to-your-router's-status-page
        fw-skip=any-string-preceding-your-IP-address

     ddclient does something like this to provide builtin support for
     common routers.
     For example, the Linksys routers could have been added with:
        fw=192.168.1.1/Status.htm
        fw-skip=WAN.*?IP Address

     OR
     Send me the output from:
      $ ddclient -geturl {fw-ip-status-url} [-login login [-password password]]
     and I'll add it to the next release!

     ie. for my fw/router I used:
        $ ddclient -geturl 192.168.1.254/status.htm

  5. Some broadband routers require the use of a password when ddclient
     accesses its status page to determine the router's WAN IP address.
     If this is the case for your router, add
        fw-login=your-router-login
        fw-password=your-router-password
     to the beginning of your ddclient.conf file.
     Note that some routers use either 'root' or 'admin' as their login
     while some others accept anything.

 

IP Detection

ddclient supports detecting the public IP address either directly from a hardware interface, from a status page provided by a NAT router, or via our CheckIP service. Due to this flexibility, ddclient can be used in almost any possible network configuration.

System Compatibility

ddclient is a Perl based script, and as such should be runnable on any system that supports Perl. Officially all "posix" style OSes are supported. This includes all Linux, Unix and BSD variants, including Apple's Mac OS X.

Configuration File

Update Client Configurator - Generate your conf file after reading how to run ddclient

Because ddclient supports multiple DDNS services, its configuration files can be fairly daunting. To help alleviate that, we're providing stripped down ddclient.conf files which are restricted to just those services which we support.

Here is a basic template which provides the various options available.
daemon=600                  # check every 600 seconds
syslog=yes                  # log update msgs to syslog
mail=root                   # mail all msgs to root
mail-failure=root           # mail failed update msgs to root
pid=/var/run/ddclient.pid   # record PID in file.
cache=/tmp/ddclient.cache   # Cache file

### Select one of these options to determine your IP address

## via hardware interface (if you don't have a router/firewall)
#use=if, if=eth0

## via our CheckIP server
#use=web, web=checkip.dyndns.com/, web-skip='IP Address'

## from the status page for a linksys router/firewall
#use=linksys, fw=linksys, fw-login=admin, fw-password=admin

## from a FW status page
#fw-login=admin, fw-password=XXXXXX
#use=fw, fw=192.168.1.254/status.htm, fw-skip='IP Address'


## Enter your DynDNS.com username and password here

#login=your-login           # your DynDNS.com username
#password=your-password     # your DynDNS.com password


## This section requires no changes unless you need to set a default proxy server
## or you need to bypass your proxy server (because it interferes with the updates)

protocol=dyndns2                    # default protocol
server=members.dyndns.org           # default server
#server=members.dyndns.org:8245     # default server (bypassing proxies)
#proxy=fasthttp.sympatico.ca:80     # default proxy


## Default options for Dynamic/Static DNS Hosts

#mx=             # default MX host (leave undefined by default)
#backupmx=NO     # MX host is primary MX? (leave undefined by default)
wildcard=YES     # add wildcard CNAME?

## Dynamic DNS hosts go here
#your-dynamic-host.dyndns.org,another-dynamic-host.dyndns.org

## Static DNS hosts go here
#static=yes, your-static-host.dyndns.org,another-static-host.dyndns.org

## Custom DNS hosts go here
#custom=yes, your-domain.top-level,your-other-domain.top-level

Here is a minimal ddclient.conf file designed to update a single Dynamic DNS host plus a single Custom DNS host and using our CheckIP service to get the IP address:

# Basic configuration file for ddclient
#
# /etc/ddclient.conf

daemon=600
cache=/tmp/ddclient.cache
pid=/var/run/ddclient.pid
use=web, web=checkip.dyndns.com/, web-skip='IP Address'
login=your-username
password=your-password
protocol=dyndns2
server=members.dyndns.org
wildcard=YES
example.dyndns.org
custom=yes, example.com

Here is a third example which shows ddclient configured to get it's IP address from the status page provided by a router. Note that here we've set the deamon sleep period to 60 seconds (the smallest value ddclient accecpt as a sleep value).

# Basic configuration file for ddclient
#
# /etc/ddclient.conf

daemon=60
cache=/tmp/ddclient.cache
pid=/var/run/ddclient.pid
use=linksys, fw=linksys, fw-login=admin, fw-password=admin
login=your-username
password=your-password
protocol=dyndns2
server=members.dyndns.org
custom=yes, example.com

Secure Updates

Since 3.7.0, ddclient support ssl-updates To use ssl, put "ssl=yes" in your configuration and make sure you have IO::Socket::SSL.

# Basic HTTPS configuration file for ddclient
#
# /etc/ddclient.conf

daemon=600
pid=/var/run/ddclient.pid
ssl=yes
use=web, web=checkip.dyndns.com/, web-skip='IP Address'
login=your-username
password=your-password
protocol=dyndns2
server=members.dyndns.org
wildcard=YES
example.dyndns.org
custom=yes, example.com

On debian, you need libio-socket-ssl-perl to have IO::Socket::SSL

Issues To Be Aware Of

  1. The DynDNS.com update protocol supports values of "NOCHG" for the MX, BACKMX, and WILDCARD options, but ddclient does not support these values. Entering these values in the ddclient.conf file will result in ddclient not setting those options in the update command at all.
  2. The DynDNS.com protocol specification has the option as BACKMX, but in the ddclient.conf file this is specified using the option "BACKUPMX". ddclient does send the correct parameter in the update command, you just need to be sure to use the ddclient version of the option in the config file.
  3. ddclient can be run either daemon mode, or as a single shot update fired off from crontab or other similar process. When using it in conjunction with CheckIP or monitoring a hardware interface you should always run it in daemon mode.
  4. ddclient currently only supports updates via http. Updates over https are not supported at this time. HTTPS support has been added as of version 3.7.0.
728x90

댓글