Kragen's simple dynamic-DNS server
==================================

I have dynamically-assigned IP addresses through my ISP.  I thought it would
be nice to have a stable hostname so people can reach me.

So I threw together this quick hack.

dynamic-dns
-----------
This is the server.  It writes dynamic-IP information in a hosts file the DNS
server can read.  Whenever it receives an update, it outputs a line indicating
that the DNS server should be restarted (preferably with SIGHUP).

It doesn't need to be run as root, just as the person with permission to write
the hosts file, and permission to read the setup files -- but not write them.

It is written in Perl.

It currently has no persistent storage of data; if it exits because of a bug
or upgrade, the next update erases all the old information.  This is a problem,
because currently, the only way to get it to reread information about hosts,
owners, and passwords is to restart it.

sighup-named
------------
This is a very simple C program.  Whenever it can read some input, it sends a
SIGHUP to the nameserver.  It is intended to be run, as root, with
dynamic-dns's output piped to it.

This design is intended to minimize the impact of stupid security holes in
dynamic-dns.

This program should not be writable by the user dynamic-dns runs as.

dynamic-dns-client
------------------
This is the program that people run on their home computers, the ones that
have dynamically-assigned IP addresses.  The idea is that when their IP address
changes, they run this program to connect to the server and inform it of the
update.

It is also written in Perl.

start-server
------------
This is a quick shell script for root to run.  It will probably need to be
modified for other sites, but it's only 9 lines long :)



Bugs
====
This is a prototype implementation.  I may want to change things (like the
protocol, for one!) before I release it to the world at large.

The protocol is currently rather insecure:
1) It's vulnerable to replay attacks -- passwords are sent in plaintext.
2) Replay attacks could be launched from a spoofed IP address.
3) There's no way to determine if someone loses network connectivity abruptly;
	this means that when you telnet to what you think is someone's IP
	address, you may actually be telnetting to their successor.
	There *is* a way for people to inform the server that they are about
	to lose their IP.
4) Clients can screw up the database and keep named from being able to read it:
kragen@gentle:/var/named/dynamic> ./dynamic-dns-client hosts.dyn.client.pass localhost gentle kragen "A this-is-an-invalid-address-haha" 
(no error message, but in syslog:)
May  2 08:52:07 gentle named[92]: reloading nameserver
May  2 08:52:07 gentle named[92]: dynamic/hosts.dyn.db: line 19: database format error (this-is-an-invalid-address-haha)
May  2 08:52:07 gentle named[92]: primary zone "dynamic.dns" rejected due to errors (serial 69)
May  2 08:52:07 gentle named[92]: Ready to answer queries.

  ... and now no hostnames in the dynamic.dns domain can be resolved.
  (dynamic.dns. was the domain I used for initial testing.)
