mastershadow / static-dhcp-dns

Static DHCP DNS editor for dhcpd and unbound on FreeBSD

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

static-dhcp-dns

Static DHCP DNS editor for dhcpd and unbound on FreeBSD (probably ok on other *nix-like OSes)

Made with love by Eduard Roccatello. We are actually using this at 3DGIS!

Static DHCP DNS Editor

Based on PHP and MYSQL.

Install

  • Configure apache to point to public folder (as alias or vhost. htaccess is needed so if you use nginx just create the appropriate rules)
  • Create mysql database
  • Create config.php
  • Launch composer
  • Launch bower
  • Give write permission to OUTDIR

Warning

This only creates files. You have to import them / copy them using whathever you like (cron script, manual commands, etc).

Example copy script

#!/bin/sh

DHCP_SRC=/usr/local/www/apache24/static-dhcp-dns/out/dhcp-static.conf
DHCP_DST=/usr/local/etc/dhcp-static.conf
DNS_SRC=/usr/local/www/apache24/static-dhcp-dns/out/dns-hosts.conf
DNS_DST=/usr/local/etc/unbound/dns-hosts.conf

diff $DHCP_SRC $DHCP_DST > /dev/null 2>&1
if [ $? -eq 1 ] ; then
        cp $DHCP_SRC $DHCP_DST;
        /usr/sbin/service isc-dhcpd restart;
fi

diff $DNS_SRC $DNS_DST > /dev/null 2>&1
if [ $? -eq 1 ] ; then
        cp $DNS_SRC $DNS_DST;
        /usr/sbin/service unbound restart;
fi

About

Static DHCP DNS editor for dhcpd and unbound on FreeBSD

License:MIT License


Languages

Language:PHP 83.0%Language:JavaScript 16.2%Language:ApacheConf 0.9%