]> mj.ucw.cz Git - nsc-5.git/blob - m4/mkconf.m4
README: Fix section numbering
[nsc-5.git] / m4 / mkconf.m4
1 dnl ###
2 dnl ### NSC -- BIND Config File Builder
3 dnl ### (c) 1997--2011 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 "zone/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 "bak/nsc_file_name($1)";
25         masters { $2; };
26 ZZ_OPTIONS()dnl
27 };
28
29 divert(-1)')
30
31 # Definition of a forwarding zone
32
33 define(`FORWARDING', `divert(0)zone "$1" in {
34         type forward;
35         forward only;
36         forwarders { FORWard(shift($@),)};
37 ZZ_OPTIONS()dnl
38 };
39
40 divert(-1)')
41
42 define(`FORWard', `patsubst(`$*',`,',`; ')')
43
44 # Blackhole zones
45
46 define(`BLACKHOLE', `divert(0)zone "$1" in {
47         type master;
48         file "zone/blackhole";
49 };
50
51 divert(-1)')
52
53 # Manual insertion of config file material
54
55 define(`CONFIG', `divert(0)$1
56 divert(-1)')
57
58 # Setting domain options
59
60 define(`ZZ_OPTIONS', `')
61
62 define(`ZONE_OPTIONS', `define(`ZZ_OPTIONS', ifelse(`$1',`',`',``       $1''))')
63
64 # The preamble
65
66 divert(0)dnl
67 `#'
68 `#'     BIND configuration file
69 `#'     Generated by NSCVER (mkconf.m4) on CURRENT_DATE
70 `#'     Please don't edit manually
71 `#'
72
73 divert(-1)