]> mj.ucw.cz Git - nsc-5.git/blob - m4/mkconf.m4
7cbde7610ab922f8436bbcd1b0edf0fe23e0eeca
[nsc-5.git] / m4 / mkconf.m4
1 dnl ###
2 dnl ### NSC -- BIND Config File Builder
3 dnl ### (c) 1997--2006 Martin Mares <mj@ucw.cz>
4 dnl ###
5 include(m4/dnslib.m4)
6
7 # Definition of primary domains
8
9 define(`DO_PRIMARY', `divert(0)zone "$1" in {
10         type master;
11         file "ZONEDIR/nsc_file_name($2)";
12 ZZ_OPTIONS()dnl
13 };
14
15 divert(-1)')
16
17 define(`PRIMARY', `DO_PRIMARY($1,$1)')
18 define(`REVERSE', `DO_PRIMARY(REV($1),nsc_if_v6($1,`nsc_revblock6($1)',`nsc_revaddr($1)'))')
19
20 # Definition of secondary domain
21
22 define(`SECONDARY', `divert(0)zone "$1" in {
23         type slave;
24         file "BAKDIR/nsc_file_name($1)";
25         masters { $2; };
26 ZZ_OPTIONS()dnl
27 };
28
29 divert(-1)')
30
31 # Definition of forwarders for both normal and slave mode
32
33 define(`FORWard', `patsubst(`$*',`,',`; ')')
34 define(`FORWArd', `     forward $1;
35         forwarders { FORWard(shift($@),)};
36 ')
37
38 define(`FORWARD', `FORWArd(first, $@)')
39 define(`SLAVE', `FORWArd(only, $@)')
40
41 divert(-1)')
42
43 # Definition of a forwarding zone
44
45 define(`FORWARDING', `divert(0)zone "$1" in {
46         type forward;
47         forward only;
48         forwarders { FORWard(shift($@),)};
49 ZZ_OPTIONS()dnl
50 };
51
52 divert(-1)')
53
54 # Blackhole zones
55
56 define(`BLACKHOLE', `divert(0)zone "$1" in {
57         type master;
58         file "zone/blackhole";
59 };
60
61 divert(-1)')
62
63 # Manual insertion of config file material
64
65 define(`CONFIG', `divert(0)$1
66 divert(-1)')
67
68 # Setting domain options
69
70 define(`ZZ_OPTIONS', `')
71
72 define(`ZONE_OPTIONS', `define(`ZZ_OPTIONS', ifelse(`$1',`',`',``       $1''))')
73
74 # The preamble
75
76 divert(0)dnl
77 `#'
78 `#'     BIND configuration file
79 `#'     Generated by NSCVER (mkconf.m4) on CURRENT_DATE
80 `#'     Please don't edit manually
81 `#'
82
83 options {
84         directory "ROOT";
85         interface-interval 0;
86 BIND_OPTIONS
87 };
88
89 zone "." in {
90         type hint;
91         file "ROOTCACHE";
92 };
93
94 divert(-1)