Generating DNS & DHCP Configurations

Generation of BIND and dhcpd configurations files is done using command-line utility sauron. Configuration files can be generated at the server where Sauron and PostgreSQL are installed, or Sauron software can be installed also in the actual DNS & DHCP server and configured to connect to PostgreSQL database over network (if connecting PostgreSQL over the network SSL connection should be used).

To generate complete BIND configuration file set as well as dhcpd configuration file, following command could be used:
      ./sauron --bind --dhcp --updateserial ns1 /opt/ns/
      
This will create configuration files for server "ns1". Option --updateserial forces the update of zone SOA serial numbers. Normally Sauron tries to detect if zone serial number update is necessary and update it only when needed, but this detection routine may sometimes fail, so for now it's recommended to use --updateserial option.

Sauron should always generate valid configuration files for BIND and dhcpd, but to be sure and automatically validate generated files, there is --check option that causes sauron command to check generated files. For this to work you need to set specify the locations of dhcpd, named-checkconf, and named-checkzone programs in Sauron configuration file. Here's an example for enabling --check option to work in a RedHat Linux:
# set to enable dhcpd.conf validation from sauron
$SAURON_DHCP_CHK_PROG = '/usr/sbin/dhcpd';
$SAURON_DHCP_CHK_ARGS = '-q -t -cf';

# set to enable named.conf validation from sauron
$SAURON_NAMED_CHK_PROG = '/usr/sbin/named-checkconf';
$SAURON_NAMED_CHK_ARGS = '';

# set to enable zone file validation from sauron
$SAURON_ZONE_CHK_PROG = '/usr/sbin/named-checkzone';
$SAURON_ZONE_CHK_ARGS = '-q';
      
It is also possible to tell sauron to send e-mail notifications to users whose changes are in effect after new configuration files are put into use using the --mail option. For this option to work you need to configure a mailer program for Sauron to use in configuration file. Here's example how to do this in a RedHat Linux:
# mailer configuration (set to enable email notifications)
$SAURON_MAILER = '/usr/sbin/sendmail';
$SAURON_MAILER_ARGS = '-t'; 
$SAURON_MAIL_FROM = 'postmaster@middle.earth'; 
      
This configures Sauron to use Sendmail for sending e-mail notifications, and messages will appear to come from
.

You can automate BIND & dhcpd configuration files generation using for example a simple shell script that is run periodically from cron. But you should use --check option when doing this to make sure you always end up with valid configuration files.