Skip to content


Folders and files

Last commit message
Last commit date

Latest commit



9 Commits

Repository files navigation


This is a DNS synchronization solution for DJBDNS with DDNS support.

There two main parts in this:

  • dnssync - the sync logic
  • dnssync-web - the DDNS frontend daemon

Both service running in the daemontools environment.


dnssync depends on:

  • daemontools
  • daemontools-run
  • djbdns


The dnssync is synchronization daemon which periodically checks local and remote serials for the configured zones. If a zone serial updated a zone transfer will begin. Written in Bash.


Environment variables

  • DDNS - Enable DDNS sync (value: 0 or 1, default: 1)
  • DDNSURL - URL for retriving the DDNS zone, this the dnssync-web URL (default: http://test.domain.tld/dnssync/retrive/)
  • PERIOD - Checking period in seconds (default: 300)
  • ROOT - Root directory path for dnssync (default: /var/dns/dnssync/root)
  • TIMEOUT - Timeout for checking remote serial and retriving DDNS zone file in seconds (default: 5)
  • TINYDNSDIR - Local TinyDNS root directory / zones directory (default: /var/dns/tinydns/root/primary)
  • TMPDIR - Directory path for temporary files (default: /tmp)
  • UPDATESCRIPT - This is a path for a script which makes data.cdb for TinyDNS (default: /usr/local/bin/dnssync_update)
  • ZTMETHOD - Zone transfer method - only axfr implemented (default: axfr)

Root structure

Root directory example for better understanding:


Adns directory means authoritative dns. In this directory other directories have to be created with DNS servers' name. Under the DNS server directories files have to be created with domain names which wanted to synchronized. The initial content of the domain files must be 0. Dnssync stores zone serial there.

Ddns directory: not implemented yet.

Update script

The update script path defined in the environment variables. This script is used to execute functions when zone need to be updated (and this script updates the zone under TinyDNS):

svc -h /service/dnscache


This is a webserver for updating IPs for DDNS domains and retriving DDNS zone. This is the modified version of tinyhttpd written in C.


Environment variables

  • IP - binding IP (default:
  • PORT - binding port (default: 80)
  • ROOT - Root directory path for dnssync-web (default: /var/dns/dnssync-web/root)
  • THREADMAX - Maximum number of concurrent threads (default: 10)

Root structure

Root directory example for better understanding:


There are two main directories under root: clients and server.

Under clients directory we define the DDNS client domains as a directory. Under each client there are three files: IP, TTL, KEY:

  • The IP file stores the current IP address of the client (default:
  • The TTL file stores the Time To Live value of the IP in seconds (default: 60)
  • The KEY file stores a key value for the client, which determines the client at IP update HTTP calls. The key should be a string of letters and numbers.

Under servers directory we define files with names of the name servers which allowed to retrive the DDNS zone. The files should be empty.

Updating client IP

The client IP can be updated by a simple HTTP GET request to the dnssync-web server. For example:


where 5BEKrNynsaZ4Xwy is the KEY of the john.ddns.domain.tld.

Retriving DDNS zone

DDNS can be retrived by a simple HTTP GET request from the allowed servers to the dnssync-web server. For example:


The response is in TinyDNS format.


DNS Synchronization solution for DJBDNS with DDNS support







No releases published


No packages published