From 99b8524c16cc99ceeaf1ebf588f2fc0f2c0fbe0a Mon Sep 17 00:00:00 2001 From: Cullum Smith Date: Sat, 12 Oct 2024 08:14:59 -0400 Subject: add a bunch of hostclasses --- scripts/hostclass/authoritative_nameserver | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 scripts/hostclass/authoritative_nameserver (limited to 'scripts/hostclass/authoritative_nameserver') diff --git a/scripts/hostclass/authoritative_nameserver b/scripts/hostclass/authoritative_nameserver new file mode 100644 index 0000000..69a7dde --- /dev/null +++ b/scripts/hostclass/authoritative_nameserver @@ -0,0 +1,27 @@ +#!/bin/sh + +: ${nsd_zones:=''} +: ${nsd_threads:='2'} + +# nsd_zones='example1 example2' +# nsd_example1_domain=example.com +# nsd_example1_slaves='1.2.3.4 5.6.7.8' + +nsd_conf_dir=/usr/local/etc/nsd +nsd_run_dir=/var/run/nsd + +# Install packages. +pkg install -y nsd + +# Generate nsd configuration. +install_template -m 0644 /usr/local/etc/nsd/nsd.conf + +# Copy zone files. +for zone in $nsd_zones; do + eval "zone_name=\${nsd_${zone}_zone}" + install_file -m 0644 "${nsd_conf_dir}/${zone_name}.zone" +done + +# Enable and start nsd. +sysrc -v nsd_enable=YES +service nsd restart -- cgit v1.2.3