Added config file. Primary is extra config item now.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dnstools.conf Tue Jun 29 09:54:44 2010 +0200
@@ -0,0 +1,6 @@
+SECONDARY=hh.schlittermann.de
+PRIMARY=pu.schlittermann.de
+THIS_HOST=
+THIS_IP=
+THIS_DOMAIN=
+
--- a/mkdomain Mon Jun 28 18:02:04 2010 +0200
+++ b/mkdomain Tue Jun 29 09:54:44 2010 +0200
@@ -17,11 +17,15 @@
start=$(date -I)
# config
+source dnstools.conf
-secondary=hh.schlittermann.de
-this_host=ns1.eins.lan #${this_host=$(hostname -f)}
-this_ip=192.168.0.1 #${this_ip=$(hostname -i)}
-this_domain=eins.lan #${this_domain=$(hostname -d)}
+secondary=$SECONDARY
+secondary_ip=${secondary_ip=$(dig +short $secondary)}
+
+this_host=${THIS_HOST:-$(hostname -f)}
+this_ip=${THIS_IP:-$(hostname -i)}
+this_domain=${THIS_DOMAIN:-$(hostname -d)}
+primary=${PRIMARY:-$this_host}
hostmaster=${hostmaster="hostmaster.$this_domain"}
@@ -31,14 +35,13 @@
test -d $primary_dir || mkdir $primary_dir
test -d $master_dir || mkdir $master_dir
-secondary=${secondary?}
-secondary_ip=${secondary_ip=$(dig +short $secondary)}
# debug option
if test $opt_debug; then
cat <<xxx
this host: $this_host [$this_ip]
this domain: $this_domain
+primary: $primary
secondary: $secondary [$secondary_ip]
hostmaster: $hostmaster
primary directory: $primary_dir
@@ -74,7 +77,7 @@
IN TXT "start: $start"
IN TXT "utf8: $utf8domain"
- IN NS $this_host.
+ IN NS $primary.
IN NS $secondary.
xxx