Skip to content
Dynamic DNS Update Daemon
Branch: master
Clone or download
niklata Merge pull request #4 from fbrosson/ncmsrc
Add missing ncmlib/io.c to NCMSRC.
Latest commit 5b30230 Nov 13, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
CHANGES Update README, CHANGES, and version number to reflect branch split. Dec 29, 2015
CMakeLists.txt Compile C++ as C++14 rather than C++0x. Dec 26, 2015
Makefile.in Add missing ncmlib/io.c to NCMSRC. Nov 9, 2017
README Add information about running on Raspberry Pi / ARM7vl. May 1, 2016
UPGRADING Minor phrasing change in UPGRADING to match wikidocs. Feb 15, 2013
bsd.c Update to latest ncmlib. Mar 30, 2014
bsd.h Update to latest ncmlib. Mar 30, 2014
cfg.c Update to latest ncmlib. Make all options configurable via the config Mar 31, 2014
cfg.h Update to latest ncmlib. Mar 30, 2014
checkip.c Update to latest ncmlib. Mar 30, 2014
checkip.h Update to latest ncmlib. Mar 30, 2014
config.h.in Use strnkc(py|at) instead of strlc(py|at). May 6, 2013
configure.in Update README, CHANGES, and version number to reflect branch split. Dec 29, 2015
defines.h Update to latest ncmlib. Mar 30, 2014
dns_he.c Update to latest ncmlib. Mar 30, 2014
dns_he.h Update to latest ncmlib. Mar 30, 2014
dns_helpers.c Update to latest ncmlib. Mar 30, 2014
dns_helpers.h Update to latest ncmlib. Mar 30, 2014
dns_nc.c Update to latest ncmlib. Mar 30, 2014
dns_nc.h Update to latest ncmlib. Mar 30, 2014
linux.c Update to latest ncmlib. Mar 30, 2014
linux.h Update to latest ncmlib. Mar 30, 2014
ndyndns.1.gz Update to latest ncmlib. Make all options configurable via the config Mar 31, 2014
ndyndns.c Use new write_pid semantics and don't write a pidfile by default. May 6, 2016
ndyndns.conf.5.gz Update to latest ncmlib. Make all options configurable via the config Mar 31, 2014
ndyndns.h Update to latest ncmlib. Make all options configurable via the config Mar 31, 2014
sun.c Update to latest ncmlib. Mar 30, 2014
sun.h Update to latest ncmlib. Mar 30, 2014
util.c Update to latest ncmlib. Mar 30, 2014
util.h Update to latest ncmlib. Mar 30, 2014

README

ndyndns - dynamic dns update daemon
(C) 2005-2015 Nicholas J. Kain.  Licensed under 2-clause BSD.

REQUIREMENTS
============

Linux-based system (2.6.x/3.x/glibc 2.x tested)
BSD-based system (OpenBSD 3.8 tested)
MacOS (10.5 tested)

gcc (3.3.5+ tested), curl+libcurl (7.14.0+ tested)

Note that it is quite possible to add support for unsupported systems.  Please
refer to bsd.c or linux.c and duplicate the platform-specific functions defined
there for your operating system.

It will also be necessary to update the configure system to reflect the
requirements for your libc to resolve dns names.

PLATFORM NOTES
==============

x86_64: No issues.  Primary development platform.
x86: No issues.
ARM7vl (Raspberry Pi): chroot must be disabled with -x flag.

DOWNLOADING
===========

If you need to update ndyndns, the latest version can be found at:

https://github.com/niklata/ndyndns/tree/master


INSTALLING
==========

It is much easier to install ndyndns from a distro-provided package, since
they will almost certainly set up a correct chroot enviromnent for you.  The
following instructions are for performing a generic install that is relatively
distro-agnostic.  Using vendor packages is highly reccomended if they are
available, since it will spare you the pain of setting up a working chroot.

If you have problems, I suggest running ndyndns in the foreground so that you
can see errors printed at the command prompt.  It will make debugging your
chroot and configuration much easier.

Building:
--------

./configure
make
make install
groupadd -g dyndns
useradd -g dyndns dyndns
mkdir /var/lib/ndyndns
chown dyndns.dyndns /var/lib/ndyndns
vim /etc/ndyndns.conf

-----------------
example config
-----------------

[config]
chroot = /var/lib/ndyndns
user = dyndns
group = dyndns
interface = eth0

[namecheap]
password = 390842ab834343
hosts = testhost2.test

[he]
userid = 30943842094820948092384
passhash = 934830984028420894201
tunnelids = 943943

-----------------


Constructing the chroot:
-----------------------

The following files and devices should be created in your chroot directory
(by default, /var/lib/ndyndns).  Either copies or hardlinks will work fine;
avoid softlinks, since they won't resolve from within the chroot.

.:
dev  etc  var

./dev:
null  random  urandom

./etc:
hosts  nsswitch.conf  resolv.conf

./var:

If you are using default paths (/var/lib/ndyndns) and user/group
(dyndns/dyndns), then the following commands will set up correct permissions.

find /var/lib/ndyndns -exec chmod 644 {} \;
find /var/lib/ndyndns -type d -exec chmod 755 {} \;
find /var/lib/ndyndns -exec chown root.root {} \;
chown dyndns.dyndns /var/lib/ndyndns/var
chmod 700 /var/lib/ndyndns/var

Then all that remains is to invoke ndyndns.  Make certain to replace "eth0"
with the name of the network interface associated with the IP that you wish
to be updated to your dyndns records (eg, for a PPPoE interface on Linux,
it is probably correct to replace eth0 with ppp0).

ndyndns -f /etc/ndyndns.conf

ADDITIONAL NOTES
================

If the system running ndyndns is not your border device (eg, it is behind a
router or firewall, and its IP address is not internet-routable), you should
add the -r switch to ndyndns.  The -r switch will instruct ndyndns to use
the IP returned by checkip.dns.he.net.  Note that -r should only be used
if necessary: checkip.dns.he.net will not be queried more than once every ten
minutes.

If chroot is not an option for your system, then you may use the -x or
--disable-chroot switch to skip the actual call to chroot().  Note
that you must still construct the environment that would be used for a
chroot as described above (although the etc and dev trees may be
omitted): it is the location where your state files will be stored.
The -c (--chroot) path will indicate the location of these files as
usual and must be specified.  Running without chroot() is not
recommended unless your environment cannot support it.

TROUBLESHOOTING
===============

Note that for certain classes of error, ndyndns will refuse to update a
given hostname.  This condition will only affect one hostname if multiple
hosts are present.  The error can be found by looking at
<CHROOTDIR>/<HOST>-dnserr.  Once the problem has been corrected, it is
only necessary to remove the corresponding <CHROOTDIR>/<HOST>-dnserr file
to resume updates.

ndyndns atomically keeps state information in the <CHROOTDIR>.  If it
becomes outdated, corrupt, or whatever, just delete the files there.  However,
it's not a good idea to unnecessarily remove these files, since they are
what allow ndyndns to avoid frivolous updates between restarts and reboots.

If the system running ndyndns does not have a network interface that has your
external IP address (ie, the one you wish your dyndns records to contain), then
try running ndyndns with the --remote (-r) switch.  It will query
checkip.dns.he.net for your external IP address rather than polling the IP
address of your network interface.

THANKS
======

Matthew Horsfall for very patiently reviewing the program and reporting
a great many robustness and build fixes, particularly on BSD.

Junji Takagi for providing some necessary fixes for BSD platforms, as
well as some documentation and consistency fixes.

Taylor R. Campbell for spotting a bug in the signal handling code, and
suggesting the implementation of a facility to read configuration files
from standard input.

Seth Fulton for spotting a bug in subdomain updates for Namecheap ddns.

You can’t perform that action at this time.