1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
4 <TITLE>Master File Format</TITLE>
8 <H2>BIND Configuration Guide -- Master File Format</H2>
13 The Master File Format was initially defined in
14 <A HREF=http://ds.internic.net/rfc/rfc1035.txt>RFC 1035</A>
15 and has subsequently been extended.
17 While the Master File Format is class independent all records in a
18 Master File must be of the same class.
20 <H3>Master File Directives</H3>
22 Syntax: <CODE>$ORIGIN <domain-name> [<comment>]</CODE>
24 <CODE>$ORIGIN</CODE> set the domain name that will be appended to any
26 When a zone is first read in there is an implict <CODE>$ORIGIN</CODE>
28 The current <CODE>$ORIGIN</CODE> is appended to the domain specified in the
29 <CODE>$ORIGIN</CODE> argument if it is not absolute.
38 WWW.MYZONE.EXAMPLE. CNAME MAIN-SERVER.MYZONE.EXAMPLE.
42 Syntax: <CODE>$INCLUDE <filename> [<origin>] [<comment>]</CODE>
44 Read and process the file filename as if it was included into the file at this
45 point. If origin is specified the file is processed with <CODE>$ORIGIN</CODE>
46 set to that value otherwise the current <CODE>$ORIGIN</CODE> is used.
47 <I>NOTE: The behaviour when <origin> is specified differs from that
49 <A HREF=http://ds.internic.net/rfc/rfc1035.txt>RFC 1035</A>.</I>
51 The origin and current domain revert to the values they were prior to the
52 <CODE>$INCLUDE</CODE> once the file has been read.
54 Syntax: <CODE>$TTL <default-ttl> [<comment>]</CODE>
56 Set the default Time To Live (TTL) for subsequent records with undefined
57 TTL's. Valid TTL's are of the range 0-2147483647.
59 <CODE>$TTL</CODE> is defined in
60 <A HREF=http://ds.internic.net/rfc/rfc2308.txt>RFC 2308</A>.
61 <H3>BIND Master File Extentions</H3>
63 Syntax: <CODE>$GENERATE <range> <lhs> <type> <rhs>
64 [<comment>]</CODE>
66 <CODE>$GENERATE</CODE> is used to create a series of resource records
67 that only differ from each other by an iterator. <CODE>$GENERATE</CODE>
68 can be used to easily generate the sets of records required to support
69 sub /24 reverse delegations described in
70 <A HREF=http://ds.internic.net/rfc/rfc2317.txt>RFC 2317: Classless IN-ADDR.ARPA delegation</A>.
73 $ORIGIN 0.0.192.IN-ADDR.ARPA.
74 $GENERATE 1-2 0 NS SERVER$.EXAMPLE.
75 $GENERATE 1-127 $ CNAME $.0
79 0.0.0.192.IN-ADDR.ARPA NS SERVER1.EXAMPLE.
80 0.0.0.192.IN-ADDR.ARPA NS SERVER2.EXAMPLE.
81 1.0.0.192.IN-ADDR.ARPA CNAME 1.0.0.0.192.IN-ADDR.ARPA.
82 2.0.0.192.IN-ADDR.ARPA CNAME 2.0.0.0.192.IN-ADDR.ARPA.
84 127.0.0.192.IN-ADDR.ARPA CNAME 127.0.0.0.192.IN-ADDR.ARPA.
89 This can be one of two forms:
90 <I>start</I>-<I>stop</I>
92 <I>start</I>-<I>stop</I>/<I>step</I>. If the first form is
93 used then step is set to 1. All of start, stop and step must be positive.
96 Lhs describes the owner name of the resource records to be created.
97 Any single $ symbols within the LHS side are replaced by the iterator value.
98 To get a $ in the output use \$. If the lhs is not absolute
99 the current $ORIGIN is appended to the name, when appropriate.
100 You can also apply an offset to the iterator by using ${offset} where
101 offset is a decimal value to add to the iterator.
102 And you can also change the format of the iterator by using a printf
103 like string. The format is ${offset,width,radix} where offset is as before
104 (use 0 for no change), width is the minimum field width (always zero padded)
105 radix is one of d, o, x, or X to change the radix to decimal, octal, hex, or hex
106 with capital letters.
107 The default is ${0,1,d}.
108 For example: ${16,3} will add 16 to the iterator and be replaced by
109 a 3 digit decimal representation. ${0,2,x} will be replaced by a 2 digit
110 hex representation. To get a { character inserted into the text
111 immediately after the iterator, use $\{.
114 At present the only supported types are A, AAAA, PTR, CNAME and NS.
117 Rhs is the data. It is processed similarly to the lhs.
120 <H2>Resource Records</H2>
121 Syntax: <CODE>{<domain>|@|<blank>}
122 [<ttl>] [<class>] <type> <rdata>
123 [<comment>]</CODE>
125 All resource records have the same basic syntax.
127 <DT><CODE>domain</CODE></DT>
129 Specify the domain name for this record. If it is not absolute the
130 current <CODE>$ORIGIN</CODE> is appended.
131 <DT><CODE>@</CODE></DT>
133 Use the current <CODE>$ORIGIN</CODE> for the domain name for this record.
134 <DT><CODE>blank</CODE></DT>
136 Use the last specified domainname.
137 <DT><CODE>ttl</CODE></DT>
139 This specifies how long this record will be cached by caching servers.
140 The valid range is 0-2147483647.
141 <DT><CODE>class</CODE></DT>
143 Specify the class of this record. This is usually redundent as the
144 class of a zone is specfied in the configuration file prior to reading
146 <DT><CODE>type</CODE></DT>
148 Specify the type of this record. This describes the contents of the rdata
150 <DT><CODE>rdata</CODE></DT>
152 This is the value of the resource record.
154 <H2>Time Values: Alternate Specification format (BIND Enhancement)</H2>
156 Many time values within the MASTER file may be specified in multiples
157 of weeks, days, hours, minutes and seconds rather than just seconds.
159 The format for this is <CODE>#w#d#h#m#s</CODE>. To specify 1 week you would
160 use <CODE>1w</CODE> or two weeks and 1 hour <CODE>2w1h</CODE>.
162 This format applies to TTL values, and SOA REFRESH, RETRY, EXPIRE and MINIMUM