[debian-lan-devel] [SCM] Debian-LAN development and packaging branch, master, updated. 0.6-24-g3b1368a
Andreas B. Mundt
andi at debian.org
Mon Aug 20 09:10:43 UTC 2012
The following commit has been merged in the master branch:
commit a4068580b46ae76b70e983f2f7b0371345c4bd21
Author: Andreas B. Mundt <andi at debian.org>
Date: Sun Aug 19 11:01:42 2012 +0200
Restructure DNS configuration setup (bind). Add FIXME.
This needs more coding to work for general subnet masks.
diff --git a/fai/config/scripts/DNS_SERVER/10-zones b/fai/config/scripts/DNS_SERVER/10-zones
index ebbf8f7..ebe097f 100755
--- a/fai/config/scripts/DNS_SERVER/10-zones
+++ b/fai/config/scripts/DNS_SERVER/10-zones
@@ -11,6 +11,59 @@ ainsl /etc/bind/named.conf.local "include \"/etc/bind/localzones\";"
## Generate the DNS configuration.
## Use variables from corresponding class/*.var file.
+# FIXME: make this more general for different subnet masks.
+
+PREFIX1=`echo $SUBNET | cut -d "." --fields=1`
+PREFIX2=`echo $SUBNET | cut -d "." --fields=2`
+FILE="/etc/bind/db.${PREFIX1}.${PREFIX2}"
+
+cat > $target/etc/bind/localzones <<EOF
+zone "${PREFIX2}.${PREFIX1}.in-addr.arpa" {
+ type master;
+ notify yes;
+ file "$FILE";
+};
+
+zone "intern" {
+ type master;
+ notify yes;
+ file "/etc/bind/db.intern";
+};
+EOF
+
+###################
+
+REV=`echo $MAINSERVER_IPADDR | cut -d "." --fields=4`
+
+cat > $target$FILE <<EOF
+\$TTL 500
+@ IN SOA mainserver.intern. root.postoffice.intern. (
+ 1 ; Serialnumber
+ 3600 ; Refresh
+ 1800 ; Retry
+ 720000 ; Expire
+ 6400 ) ; Minimum TTL
+ NS mainserver.intern.
+ MX 10 mainserver.intern.
+$REV.0 PTR mainserver.intern.
+EOF
+NUM=0
+for IPADDR in `seq $WS_RANGE` ; do
+ NUMSTR=`printf "%02d" $NUM`
+ echo "${IPADDR}.0 PTR workstation${NUMSTR}.intern." \
+ >> $target$FILE
+ NUM=$(($NUM+1))
+done
+NUM=0
+for IPADDR in `seq $DL_RANGE` ; do
+ NUMSTR=`printf "%02d" $NUM`
+ echo "${IPADDR}.0 PTR diskless${NUMSTR}.intern." \
+ >> $target$FILE
+ NUM=$(($NUM+1))
+done
+
+###################
+
cat > $target/etc/bind/db.intern <<EOF
\$TTL 500
@ IN SOA mainserver.intern. root.postoffice.intern. (
@@ -66,53 +119,3 @@ for IPADDR in `seq $DL_RANGE` ; do
>> $target/etc/bind/db.intern
NUM=$(($NUM+1))
done
-
-###################
-
-PREFIX=`echo $SUBNET | cut -d "." --fields=1,2`
-FILE="/etc/bind/db.$PREFIX.in-addr.arpa"
-
-cat > $target/etc/bind/localzones <<EOF
-zone "${PREFIX}.in-addr.arpa" {
- type master;
- notify yes;
- file "$FILE";
-};
-
-zone "intern" {
- type master;
- notify yes;
- file "/etc/bind/db.intern";
-};
-EOF
-
-###################
-
-REV=`echo $MAINSERVER_IPADDR | cut -d "." --fields=4`
-
-cat > $target$FILE <<EOF
-\$TTL 500
-@ IN SOA mainserver.intern. root.postoffice.intern. (
- 1 ; Serialnumber
- 3600 ; Refresh
- 1800 ; Retry
- 720000 ; Expire
- 6400 ) ; Minimum TTL
- NS mainserver.intern.
- MX 10 mainserver.intern.
-$REV.0 PTR mainserver.intern.
-EOF
-NUM=0
-for IPADDR in `seq $WS_RANGE` ; do
- NUMSTR=`printf "%02d" $NUM`
- echo "${IPADDR}.0 PTR workstation${NUMSTR}.intern." \
- >> $target$FILE
- NUM=$(($NUM+1))
-done
-NUM=0
-for IPADDR in `seq $DL_RANGE` ; do
- NUMSTR=`printf "%02d" $NUM`
- echo "${IPADDR}.0 PTR diskless${NUMSTR}.intern." \
- >> $target$FILE
- NUM=$(($NUM+1))
-done
--
Debian-LAN development and packaging
More information about the debian-lan-devel
mailing list