DNS zones and BIND configurations manager
1) edit settings.py variable TEMPLATE_DIRS to match the full path of the
templates folder in this project.
2) create a folder for the dns zone files, for example /var/cyberdns_zones. Chown to
your user. (chown pooya /var/cyberdns_zones)
3) create a folder for the backup of your config and zone files, for example
/var/cyberdns_backups . Chown to your user (chown pooya /var/cyberdns_backups)
4) edit settings.py variables:
5) run ./manage.py runserver from the cyberdns folder
7) open your browser to http://127.0.0.1:8000
8) add crons for synchronizing slaves and restarting bind as needed (see below).
- CyberDNS runs on the master DNS server.
- Make your dns modifications on the web and then choose Put Live!
- Once you "Put Live!", a file "restart_bind" will be touched in your ZONE_PATH and a backup will be made to
BACKUP_PATH/YYYYMMDD.HHMMSS of everything in ZONE_PATH. In the event of meltdown, just copy your files back
and restart bind to revert.
- You should add a cron like this as root on all DNS servers,
which will restart named and flush changes when needed.
*/2 * * * * root ( ZONE_PATH=/var/cyberdns_zones && NAMED_CONF=/etc/named.conf
-e $ZONE_PATH/restart_bind && -e $ZONE_PATH/named.conf &&
cp -f $ZONE_PATH/named.conf $NAMED_CONF && service named restart &&
rm -f $ZONE_PATH/restart_bind )
- The slave dns server should have crons to rsync the sqlite3 db over with zones and then restart named
(it will restart since you have the cron above, which checks for the ZONE_PATH/restart_bind file)
*/2 * * * * dnsuser ( rsync -a -e ssh dnsuser@masterdns:/path/to/cyberdns/db/cyberdns.sq3 /path/to/cyberdns/db/cyberdns.sq3 &&
rsync -a -e ssh dnsuser@masterdns:/ZONE_PATH/ /ZONE_PATH/ )