193
205
host name, this is considered bad practice and is not compatible with some
194
206
other DNS servers.
196
CNAME records are not permitted in a csv2_default_zonefile.
208
CNAME records are not permitted in a csv2_default_zonefile. If you do not
209
know what a csv2_default_zonefile is, this fact is of no relevance.
211
Historical and uncommon resource records
213
The following resource records are mainly of historical interest, or are
218
An HINFO record is a description of the CPU (processor) and OS that a
219
given host is using. The format for this record is identical to a TXT
220
record, except that the field must have precisely two chunks.
222
The first chunk of a HINFO record is the CPU the host is running; the
223
second chunk is the OS the host is running.
227
example.com. HINFO 'Intel Pentium III';'CentOS Linux 3.7'
229
This resource record is not actively used--the IANA has a list of CPUs and
230
OSes that this record is supposed to have. However, this list has not been
235
WKS records are historical records which have been superseded by SRV
236
records. The format of the record is an IP, followed by a protocol number
237
(6 means TCP), followed by a list of ports that a given server has
238
available for services.
240
For example, to advertise that example.net has the IP 10.1.2.3, and has a
241
SSH, HTTP (web), and NNTP server:
243
example.net. WKS 10.1.2.3 6 22,80,119
245
MaraDNS only allows up to 10 different port numbers in a WKS record, and
246
requires that the listed port numbers are not be higher than 1023.
250
MD and MF records are RR types that existed before MX records, and were
251
made obsolete by MX records. RFC1035 says that a DNS server can either
252
reject these records or convert these records in to MX records. BIND
253
rejects these records; MaraDNS converts them.
257
example.net. MD a.example.net.
258
example.net. MF b.example.net.
262
example.net. MX 0 a.example.net.
263
example.net. MX 10 b.example.net.
265
MB, MG, MINFO, and MR
267
In the late 1980s, an alternative to MX records was proposed. This
268
alternative utilized MB, MG, MINFO, and MR records. This alternative
269
failed to gather popularity. However, these records were codified in
270
RFC1035, and are supported by MaraDNS. Here is what the records look like:
272
example.net. MB mail.example.net.
273
example.net. MG mg@example.net.
274
example.net. MINFO rm@example.net. re@example.net.
275
example.net. MR mr@example.net.
277
More information about these records can be found in RFC1035.
279
AFSDB, RP, X25, ISDN, and RT
281
AFSDB, RP, X25, ISDN, and RT are resource records which were proposed in
282
RFC1183. None of these resource records are widely used.
284
With the exception of the ISDN record, the format of these records is
285
identical to the examples in RFC1183. The format of the ISDN record is
286
identical unless the record has a subaddress (SA). If an ISDN record has a
287
subaddress, it is separated from the ISDN-address by a ';' instead of
290
If used, here is how the records would look in a csv2 zone file:
292
example.net. AFSDB 1 afsdb.example.net.
293
example.net. RP rp@example.net. rp.example.net.
294
example.net. RP rp2@example.net. .
295
example.net. X25 311061700956
296
example.net. ISDN 150862028003217
297
example.net. ISDN 150862028003217;004
298
example.net. RT 10 relay.example.net.
302
NSAP and NSAP-PTR records were proposed in RFC1706. A NSAP record is a
303
hexadecimal number preceeded by the string "0x" and with optional dots
304
between bytes. This hexadecimal number is converted in to a binary number
305
by MaraDNS. A NSAP-PTR record is idenical to a PTR record, but has a
308
More information about these records can be obtained from RFC1706.
310
If used, here is how the records would look in a csv2 zone file:
312
example.net. NSAP 0x47.0005.80.005a00.0000.0001.e133.ffffff000162.00
313
example.net. NSAP-PTR nsap.example.net.
317
The PX RR is an obscure RR described in RFC2163. A PX record looks like
318
this in a CSV2 zone file:
320
example.net. PX 15 px1.example.net. px2.example.net.
324
An GPOS record is a description of the location of a given server. The
325
format for this record is identical to a TXT record, except that the field
326
must have precisely three chunks.
328
The first chunk of a GPOS record is the longitude; the second chunk is the
329
latitude; the third chunk is the altitude (in meters).
333
example.net. GPOS '-98.6502';'19.283';'2134'
335
More information about this record can be found in RFC1712.
337
This resource record is not actively used; for the relatively few people
338
who encode their position in DNS, the LOC record is far more common.
342
The LOC recource record is an uncommonly used resource record that
343
describes the position of a given server. LOC records are described in
346
Note that MaraDNS' LOC parser assumes that the altitude, size, horizontal,
347
and vertical precision numbers are always expressed in meters. Also note
348
that that sub-meter values for size, horizontal, and vertical precision
349
are not allowed. Additionally, the altitude can not be greater than
354
example.net. LOC 19 31 2.123 N 98 3 4 W 2000m 2m 4m 567m
358
In addition to being able to have resource records and comments, csv2 zone
359
files can also have special slash commands. These slash commands, with the
360
exception of the '/serial' slash command (see "SOA" above), can only be
361
placed where the name for a record would be placed. Note that slash
362
commands are case-sensitive, and the command in question must be in
365
These commands are as follows:
369
The default TTL is the TTL for a resource record without a TTL specified.
370
This can be changed with the '/ttl' slash command. This command takes only
371
a single argument: The time, in seconds, for the new default TTL. The
372
'/ttl' slash command only affects the TTL of records that follow the
373
command. A zone file can have multiple '/ttl' slash commands.
375
The default TTL is 86400 seconds (one day) until changed by the '/ttl'
378
In the following example, a.ttl.example.com will have a TTL of 86400
379
seconds (as long as the zone file with this record has not previously used
380
the '/ttl' slash command), b.ttl.example.com and d.ttl.example.com will
381
have a TTL of 3600 seconds, c.ttl.example.com will have a TTL of 9600
382
seconds, and e.ttl.example.com will have a TTL of 7200 seconds:
384
a.ttl.example.com. 10.0.0.1
386
b.ttl.example.com. 10.0.0.2
387
c.ttl.example.com. +9600 10.0.0.3
388
d.ttl.example.com. 10.0.0.4
390
e.ttl.example.com. 10.0.0.5
394
It is possible to change the host name suffix that is used to substitute
395
the percent in a csv2 zone file. This suffix is called, for historical and
396
compatibility reasons, "origin". This is done as the slash command
397
'/origin', taking the new origin as the one argument to this function.
398
Note that changing the origin does not change the domain suffix used to
399
determine whether a given domain name is authoritative.
401
Here is one example usage of the '/origin' slash command:
412
Which is equivalent to:
414
www.example.com. 10.1.0.1
415
example.com. MX 10 mail.example.com.
416
mail.example.com. 10.1.0.2
417
www.example.org. 10.2.0.1
418
example.org. MX 10 mail.example.org.
419
mail.example.org. 10.2.0.2
421
It is also possible to make the current origin be part of the new origin:
424
% 10.3.2.1 # example.com now has IP 10.3.2.1
426
% 10.3.2.2 # mail.example.com now has IP 10.3.2.2
430
The '/opush' and '/opop' slash commands use a stack to remember and later
431
recall values for the origin (see origin above). The '/opush' command is
432
used just like the '/origin' command; however, the current origin is
433
placed on a stack instead of discarded. The '/opop' command removes
434
("pops") the top element from this stack and makes the element the origin.
439
/opush mail.% # origin is now mail.example.com; example.com is on stack
440
a.% 10.4.0.1 # a.mail.example.com has IP 10.4.0.1
441
/opush web.example.com. # mail.example.com and example.com are on stack
442
a.% 10.5.0.1 # a.web.example.com has IP 10.5.0.1
443
b.% 10.5.0.2 # b.web.example.com has IP 10.5.0.2
444
/opop # origin is now mail.example.com again
445
b.% 10.4.0.2 # b.mail.example.com has IP 10.4.0.2
446
/opop # origin is now example.com
447
% MX 10 a.mail.% # example.com. MX 10 a.mail.example.com.
448
% MX 20 b.mail.% # example.com. MX 20 b.mail.example.com.
450
The opush/opop stack can have up to seven elements on it.
454
The '/read' slash commands allows one to have the contents of another file
455
in a zone. The '/read' command takes a single argument: A filename that
456
one wishes to read. The filename is only allowed to have letters, numbers,
457
the '-' character, the '_' character, and the '.' character in it.
459
The file needs to be in the same directory as the zone file. The file will
460
be read with the same privileges as the zone file; content in the file
461
should come from a trusted source or be controlled by the system
464
Let us suppose that we have the following in a zone file:
466
mail.foo.example.com. 10.3.2.1
468
foo.example.com. MX 10 mail.foo.example.com.
470
And a file foo with the following contents:
472
foo.example.com. 10.1.2.3
473
foo.example.com. TXT 'Foomatic!'
475
Then foo.example.com will have an A record with the value 10.1.2.3, a TXT
476
value of 'Foomatic!', and a MX record with priority 10 pointing to
477
mail.foo.example.com. mail.foo.example.com will have the IP 10.3.2.1.
479
Note that no pre-processing nor post-processing of the origin is done by
480
the '/read' command; should the file read change the origin, this changed
481
value will affect any records after the '/read' command. For example, let
482
us suppose db.example.com looks like this:
484
/origin foo.example.com.
487
% MX 10 mail.foo.example.com.
489
And the file foo looks like this:
495
Then the following records will be created:
497
foo.example.com. TXT 'Foomatic!'
498
foo.example.com. A 10.1.2.3
499
mail.foo.example.com. A 10.3.2.1
500
mail.foo.example.com. MX 10 mail.foo.example.com.
502
To have something that works like '$INCLUDE filename' in a RFC1035 master
503
file, do the following:
509
Or, for that matter, the equivalent of '$INCLUDE filename neworigin':
198
515
EXAMPLE ZONE FILE