Recipe 24.14. Synchronizing with a Second tinydns Server

 < Day Day Up > 

24.14.1 Problem

You have a second tinydns server offsite, as a backup. How do you keep it synchronized with your main tindydns server?

24.14.2 Solution

Plain old rsync-over-ssh does the job just fine. This simple script copies your DNS data file to the backup, then runs make on the remote data file:

rsync -e ssh -az /etc/tinydns/root/data $backup-host:/etc/tinydns/root/data ssh $backup-host "cd /etc/tinydns/root; make"

Replace $backup-host with the name or IP address of the remote server.

You can automate the entire process by adding these lines to /etc/tinydns/root/Makefile, so that when you run the make command on your primary server after updating /etc/tinydns/root/data, the backup will automatically be updated as well:

data.cdb: data        /usr/local/bin/tinydns-data        rsync -e ssh -az /etc/tinydns/root/data $backup-host:/etc/tinydns/root/data        ssh $backup-host "cd /etc/tinydns/root; make"

24.14.3 Discussion

Moving plain old text files doesn't require a lot of sophistication; rsync is a fine tool for the job. You may schedule regular updates via cron, or add transport security and authentication with encrypted ssh keys.

Your backup server can also function as your secondary DNS server. You can configure client PCs to use it, or register it just like your main DNS server for a public authoritative DNS server (see Recipe Recipe 24.6).

24.14.4 See Also

  • Chapter 16

  • Chapter 17

     < Day Day Up > 


    Linux Cookbook
    Linux Cookbook
    ISBN: 0596006403
    EAN: 2147483647
    Year: 2004
    Pages: 434

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net