[debian-lan-devel] [SCM] Debian-LAN development and packaging branch, squeeze, updated. 0.6-11-g12e8809
Andreas B. Mundt
andi at debian.org
Mon Aug 20 09:10:45 UTC 2012
The following commit has been merged in the squeeze branch:
commit 75348d26ba39fa5f891919b450dbbeefd6c5ce3a
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 37c1bc7..4ce415b 100755
--- a/fai/config/scripts/DNS_SERVER/10-zones
+++ b/fai/config/scripts/DNS_SERVER/10-zones
@@ -11,6 +11,59 @@ ainsl $target/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. (
@@ -65,53 +118,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