tinydnsdyn: Dynamic DNS for ‘djbdns’
This is a basic dynamic client and server for the djbdns DNS server ‘tinydns’ by Dan Bernstein.
Requirements:
- Administrative access to a server running tinydns and hence daemontools or similar
- Administrative access to a *nix box on you local network
- Python installed on both client and server
Installation
Server
To install the server code:
- Copy script and all files onto your server (i.e. /etc/tinydnsdyn/)
- The supplied ‘run’ script is tailored for debian/ubuntu and may need to be changed.
- Create a password file that contains the password on the first line
- Start the service by symlinking this directory into your svscan directory (i.e. “ln $(pwd) /etc/service/” ).
- An existing entry in the tinydns data file should already exist. This script will NOT add one. Only those hosts listed (with prefixes ’+’ and ’=’) are able to update their entries.
For example:
+groucho.example.com:192.168.0.2:3360
+groucho.example.com:192.168.0.2
=groucho.example.com:192.168.0.2:60
+*.groucho.example.com:192.168.0.2:60
+*.groucho.example.com:192.168.0.2
will all get updated if the host groucho.example.com does a request.
Client
To install the client code:
-
Copy the ‘tinydnsdyn-client’ script into your DNS client’s path (i.e. /usr/local/bin/)
-
Arrange to periodically run the ‘tinydnsdyn-client’ program (via cron et al) like so:
tinydnsdyn-client --hostname=<myhostname> --server=<mydnsserver> <passfile>
Only the passfile option is required.
- The password must obviously be the same and the requested host name must exist in the ‘data’ file.
The Python code is basic and inefficient but it should work. I take no responsibility for anything that may happen to any of your machines. That said, please let me know if there are any issues by creating a ticket on the tinydnsdyn tracker.