~ubuntu-branches/ubuntu/saucy/maradns/saucy

« back to all changes in this revision

Viewing changes to doc/en/source/csv2.ej

  • Committer: Bazaar Package Importer
  • Author(s): Kai Hendry
  • Date: 2006-10-09 17:44:21 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20061009174421-yb151elg3m4t5shl
Tags: 1.2.12.03-1
* New upstream release with many new doc tweaks. Though most of the changes
  are with the webpages which I have chosen not to distribute as you can
  read them all rather online at http://maradns.org/
* The diffs in the Makefiles are due to upstream's configure script
* Added bind2csv2.py as an example from upstream's tools/
  There is a lot of little scripts in tools/ which can probably join this

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
<p>
33
33
 
34
34
Anything in square brackets is an optional field.  If the ttl is not 
35
 
specified, the ttl is set to be 86400 seconds long (one day).  If the rtype
36
 
is not specified, it is set to be an "A" (ipv4 address) record.  
 
35
specified, the ttl is set to the default ttl value (see "Default TTL" below).  
 
36
If the rtype is not specified, it is set to be an "A" (ipv4 address) record.  
37
37
<p>
38
38
 
39
39
The zone file supports comments; comments are specified by having a '#' 
104
104
please refer to RFC 2782.  Example:
105
105
 
106
106
<pre>
107
 
_http._tcp.% srv 0 0 80 a.%
 
107
_http._tcp.% SRV 0 0 80 a.%
108
108
</pre>
109
109
 
110
110
<h2>NS</h2>
139
139
x.org. SOA x.org. email@x.org. 1 7200 3600 604800 1800
140
140
</pre>
141
141
 
 
142
The serial numeric field may be replaced by the string '/serial'; this
 
143
string tells the CSV2 zone parser to synthesize a serial number for the
 
144
zone based on the timestamp for the zone file.  This allows one to 
 
145
have the serial number be automatically updated whenever the zone file is
 
146
edited.  Here is how this special field looks in a SOA record:
 
147
 
 
148
<pre>
 
149
x.org. SOA x.org. email@x.org. /serial 7200 3600 604800 1800
 
150
</pre>
 
151
 
 
152
The '/serial' string is case-sensitive; only '/serial' in all lower
 
153
case will parse.  
 
154
 
142
155
<h2>TXT</h2>
143
156
 
144
157
A TXT record stores arbitrary text and/or binary data for a given
206
219
x.example.net:
207
220
 
208
221
<pre>
209
 
x.example.net. A 10.2.28.79
 
222
x.example.net. A 10.3.28.79
210
223
79.28.3.10.in-addr.arpa. PTR x.example.net.
211
224
</pre>
212
225
 
213
226
But the above two lines in a zone file can also be represented thusly:
214
227
 
215
228
<pre>
216
 
x.example.net. FQDN4 10.2.28.79
 
229
x.example.net. FQDN4 10.3.28.79
217
230
</pre>
218
231
 
219
232
Note that the csv2 parser does not bother to check that any given IP
239
252
 
240
253
<p>
241
254
 
242
 
CNAME records are not permitted in a csv2_default_zonefile.
 
255
CNAME records are not permitted in a csv2_default_zonefile.  If you
 
256
do not know what a csv2_default_zonefile is, this fact is of no 
 
257
relevance.
 
258
 
 
259
<h1>Historical and uncommon resource records</h1>
 
260
 
 
261
The following resource records are mainly of historical interest, or
 
262
are not commonly used.
 
263
 
 
264
<h2>HINFO</h2>
 
265
 
 
266
An HINFO record is a description of the CPU (processor) and OS that
 
267
a given host is using.  The format for this record is identical to a
 
268
TXT record, except that the field must have precisely two chunks.
 
269
 
 
270
<p>
 
271
 
 
272
The first chunk of a HINFO record is the CPU the host is running; the
 
273
second chunk is the OS the host is running.
 
274
 
 
275
<p>
 
276
 
 
277
Example:
 
278
 
 
279
<pre>
 
280
example.com. HINFO 'Intel Pentium III';'CentOS Linux 3.7'
 
281
</pre>
 
282
 
 
283
This resource record is not actively used--the IANA
 
284
has a list of CPUs and OSes that this record is supposed to have.  However,
 
285
this list has not been updated since 2002.
 
286
 
 
287
<h2>WKS</h2>
 
288
 
 
289
WKS records are historical records which have been superseded by SRV
 
290
records.  The format of the record is an IP, followed by a protocol
 
291
number (6 means TCP), followed by a list of ports that a given server
 
292
has available for services.
 
293
 
 
294
<p>
 
295
 
 
296
For example, to advertise that example.net has the IP 10.1.2.3, and has a
 
297
SSH, HTTP (web), and NNTP server:
 
298
 
 
299
<pre>
 
300
example.net. WKS 10.1.2.3 6 22,80,119
 
301
</pre>
 
302
 
 
303
MaraDNS only allows up to 10 different port numbers in a WKS record,
 
304
and requires that the listed port numbers are not be higher than 1023.
 
305
 
 
306
<h2>MD and MF</h2>
 
307
 
 
308
MD and MF records are RR types that existed before MX records, and were
 
309
made obsolete by MX records.  RFC1035 says that a DNS server can either
 
310
reject these records or convert these records in to MX records.  BIND
 
311
rejects these records; MaraDNS converts them.
 
312
 
 
313
<p>
 
314
 
 
315
Example:
 
316
 
 
317
<pre>
 
318
example.net. MD a.example.net.
 
319
example.net. MF b.example.net.
 
320
</pre>
 
321
 
 
322
Is equivalent to:
 
323
 
 
324
<pre>
 
325
example.net. MX 0 a.example.net.
 
326
example.net. MX 10 b.example.net.
 
327
</pre>
 
328
 
 
329
<h2>MB, MG, MINFO, and MR</h2>
 
330
 
 
331
In the late 1980s, an alternative to MX records was proposed.  This
 
332
alternative utilized MB, MG, MINFO, and MR records.  This alternative
 
333
failed to gather popularity.  However, these records were codified in
 
334
RFC1035, and are supported by MaraDNS.  Here is what the records look
 
335
like:
 
336
 
 
337
<pre>
 
338
example.net. MB mail.example.net.
 
339
example.net. MG mg@example.net.
 
340
example.net. MINFO rm@example.net. re@example.net.
 
341
example.net. MR mr@example.net.
 
342
</pre>
 
343
 
 
344
More information about these records can be found in RFC1035.
 
345
 
 
346
<h2>AFSDB, RP, X25, ISDN, and RT</h2>
 
347
 
 
348
AFSDB, RP, X25, ISDN, and RT are resource records which were 
 
349
proposed in RFC1183.  None of these resource records are widely
 
350
used.
 
351
 
 
352
<p>
 
353
 
 
354
With the exception of the ISDN record, the format of these records
 
355
is identical to the examples in RFC1183.  The format of the ISDN
 
356
record is identical unless the record has a subaddress (SA).  If
 
357
an ISDN record has a subaddress, it is separated from the ISDN-address
 
358
by a ';' instead of whitespace.
 
359
 
 
360
<p>
 
361
 
 
362
If used, here is how the records would look in a csv2 zone file:
 
363
 
 
364
<pre>
 
365
example.net. AFSDB 1 afsdb.example.net.
 
366
example.net. RP rp@example.net. rp.example.net.
 
367
example.net. RP rp2@example.net. .
 
368
example.net. X25 311061700956
 
369
example.net. ISDN 150862028003217
 
370
example.net. ISDN 150862028003217;004
 
371
example.net. RT 10 relay.example.net.
 
372
</pre>
 
373
 
 
374
<h2>NSAP and NSAP-PTR</h2>
 
375
 
 
376
NSAP and NSAP-PTR records were proposed in RFC1706.  A NSAP record is
 
377
a hexadecimal number preceeded by the string "0x" and with optional dots
 
378
between bytes.  This hexadecimal number is converted in to a binary number
 
379
by MaraDNS.  A NSAP-PTR record is idenical to a PTR record, but has a 
 
380
different RTYPE.
 
381
 
 
382
<p>
 
383
 
 
384
More information about these records can be obtained from RFC1706.
 
385
 
 
386
<p>
 
387
 
 
388
If used, here is how the records would look in a csv2 zone file:
 
389
 
 
390
<pre>
 
391
example.net. NSAP 0x47.0005.80.005a00.0000.0001.e133.ffffff000162.00
 
392
example.net. NSAP-PTR nsap.example.net.
 
393
</pre>
 
394
 
 
395
<h2>PX</h2>
 
396
 
 
397
The PX RR is an obscure RR described in RFC2163.  A PX record looks like
 
398
this in a CSV2 zone file:
 
399
 
 
400
<pre>
 
401
example.net. PX 15 px1.example.net. px2.example.net.
 
402
</pre>
 
403
 
 
404
<h2>GPOS</h2>
 
405
 
 
406
An GPOS record is a description of the location of a given server.
 
407
The format for this record is identical to a
 
408
TXT record, except that the field must have precisely three chunks.
 
409
 
 
410
<p>
 
411
 
 
412
The first chunk of a GPOS record is the longitude; the second chunk is
 
413
the latitude; the third chunk is the altitude (in meters).
 
414
 
 
415
<p>
 
416
 
 
417
Example:
 
418
 
 
419
<pre>
 
420
example.net. GPOS '-98.6502';'19.283';'2134'
 
421
</pre>
 
422
 
 
423
More information about this record can be found in RFC1712.
 
424
 
 
425
<p>
 
426
 
 
427
This resource record is not actively used; for the relatively few people
 
428
who encode their position in DNS, the LOC record is far more common.
 
429
 
 
430
<h2>LOC</h2>
 
431
 
 
432
The LOC recource record is an uncommonly used resource record that 
 
433
describes the position of a given server.  LOC records are described
 
434
in RFC1876.  
 
435
 
 
436
<p>
 
437
 
 
438
Note that MaraDNS' LOC parser assumes that the altitude,
 
439
size, horizontal, and vertical precision numbers are always expressed
 
440
in meters.  Also note that that sub-meter values for size, horizontal, and 
 
441
vertical precision are not allowed.  Additionally, the altitude can not 
 
442
be greater than 21374836.47 meters.
 
443
 
 
444
<p>
 
445
 
 
446
Example:
 
447
 
 
448
<pre>
 
449
example.net. LOC 19 31 2.123 N 98 3 4 W 2000m 2m 4m 567m
 
450
</pre>
 
451
 
 
452
<h1>SLASH COMMANDS</h1>
 
453
 
 
454
In addition to being able to have resource records and comments, csv2
 
455
zone files can also have special slash commands.  These slash commands,
 
456
with the exception of the '/serial' slash command (see "SOA" above),
 
457
can only be placed where the name for a record would be placed.
 
458
Note that slash commands are case-sensitive, and the command in 
 
459
question must be in all-lower-case.
 
460
 
 
461
<p>
 
462
 
 
463
These commands are as follows:
 
464
 
 
465
<h2>Default TTL</h2>
 
466
 
 
467
The default TTL is the TTL for a resource record without a TTL specified.
 
468
This can be changed with the '/ttl' slash command.  This command
 
469
takes only a single argument: The time, in seconds, for the new default TTL.
 
470
The '/ttl' slash command only affects the TTL of records that follow the
 
471
command.  A zone file can have multiple '/ttl' slash commands.
 
472
 
 
473
<p>
 
474
 
 
475
The default TTL is 86400 seconds (one day) until changed by the '/ttl'
 
476
slash command.
 
477
 
 
478
<p>
 
479
 
 
480
In the following example, a.ttl.example.com will have a TTL of 86400 
 
481
seconds (as long as the zone file with this record has not previously used
 
482
the '/ttl' slash command), b.ttl.example.com and d.ttl.example.com will 
 
483
have a TTL of 3600 seconds, c.ttl.example.com will have a TTL of 9600 
 
484
seconds, and e.ttl.example.com will have a TTL of 7200 seconds:
 
485
 
 
486
<pre>
 
487
a.ttl.example.com.       10.0.0.1
 
488
/ttl 3600
 
489
b.ttl.example.com.       10.0.0.2
 
490
c.ttl.example.com. +9600 10.0.0.3
 
491
d.ttl.example.com.       10.0.0.4
 
492
/ttl 7200
 
493
e.ttl.example.com.       10.0.0.5
 
494
</pre>
 
495
 
 
496
<h2>Origin</h2>
 
497
 
 
498
It is possible to change the host name suffix that is used to substitute the
 
499
percent in a csv2 zone file.  This suffix is called, for historical and 
 
500
compatibility reasons, "origin".  This is done as the slash command
 
501
'/origin', taking the new origin as the one argument to this function.
 
502
Note that changing the origin does <i>not</i> change the domain suffix
 
503
used to determine whether a given domain name is authoritative.
 
504
 
 
505
<p>
 
506
 
 
507
Here is one example usage of the '/origin' slash command:
 
508
 
 
509
<pre>
 
510
/origin example.com.
 
511
www.% 10.1.0.1
 
512
% MX 10 mail.%
 
513
mail.% 10.1.0.2
 
514
/origin example.org.
 
515
www.% 10.2.0.1
 
516
% MX 10 mail.%
 
517
mail.% 10.2.0.2
 
518
</pre>
 
519
 
 
520
Which is equivalent to:
 
521
 
 
522
<pre>
 
523
www.example.com. 10.1.0.1
 
524
example.com. MX 10 mail.example.com.
 
525
mail.example.com. 10.1.0.2
 
526
www.example.org. 10.2.0.1
 
527
example.org. MX 10 mail.example.org.
 
528
mail.example.org. 10.2.0.2
 
529
</pre>
 
530
 
 
531
It is also possible to make the current origin be part of the new origin:
 
532
 
 
533
<pre>
 
534
/origin example.com.
 
535
% 10.3.2.1 # example.com now has IP 10.3.2.1
 
536
/origin mail.%
 
537
% 10.3.2.2 # mail.example.com now has IP 10.3.2.2
 
538
</pre>
 
539
 
 
540
<h2>Opush and Opop</h2>
 
541
 
 
542
The '/opush' and '/opop' slash commands use a stack to remember and later
 
543
recall values for the origin (see origin above).  The '/opush' command
 
544
is used just like the '/origin' command; however, the current origin is
 
545
placed on a stack instead of discarded.  The '/opop' command removes 
 
546
("pops") the top element from this stack and makes the element the origin.
 
547
 
 
548
<p>
 
549
 
 
550
For example:
 
551
 
 
552
<pre>
 
553
/origin example.com.
 
554
/opush mail.% # origin is now mail.example.com; example.com is on stack
 
555
a.% 10.4.0.1 # a.mail.example.com has IP 10.4.0.1
 
556
/opush web.example.com. # mail.example.com and example.com are on stack
 
557
a.% 10.5.0.1 # a.web.example.com has IP 10.5.0.1
 
558
b.% 10.5.0.2 # b.web.example.com has IP 10.5.0.2
 
559
/opop # origin is now mail.example.com again
 
560
b.% 10.4.0.2 # b.mail.example.com has IP 10.4.0.2
 
561
/opop # origin is now example.com
 
562
% MX 10 a.mail.% # example.com. MX 10 a.mail.example.com.
 
563
% MX 20 b.mail.% # example.com. MX 20 b.mail.example.com.
 
564
</pre>
 
565
 
 
566
The opush/opop stack can have up to seven elements on it.
 
567
 
 
568
<h2>Read</h2>
 
569
 
 
570
The '/read' slash commands allows one to have the contents of another
 
571
file in a zone.  The '/read' command takes a single argument: A filename
 
572
that one wishes to read.  The filename is only allowed to have letters, 
 
573
numbers, the '-' character, the '_' character, and the '.' character in it.
 
574
 
 
575
<p>
 
576
 
 
577
The file needs to be in the same directory as the zone file.  The file will
 
578
be read with the same privileges as the zone file; content in the file
 
579
should come from a trusted source or be controlled by the system 
 
580
administrator.
 
581
 
 
582
<p>
 
583
 
 
584
Let us suppose that we have the following in a zone file:
 
585
 
 
586
<pre>
 
587
mail.foo.example.com. 10.3.2.1
 
588
/read foo
 
589
foo.example.com. MX 10 mail.foo.example.com.
 
590
</pre>
 
591
 
 
592
And a file foo with the following contents:
 
593
 
 
594
<pre>
 
595
foo.example.com. 10.1.2.3
 
596
foo.example.com. TXT 'Foomatic!'
 
597
</pre>
 
598
 
 
599
Then foo.example.com will have an A record with the value 10.1.2.3, a
 
600
TXT value of 'Foomatic!', and a MX record with priority 10 pointing to
 
601
mail.foo.example.com.  mail.foo.example.com will have the IP 10.3.2.1.
 
602
 
 
603
<p>
 
604
 
 
605
Note that no pre-processing nor post-processing of the origin is done
 
606
by the '/read' command; should the file read change the origin, this
 
607
changed value will affect any records after the '/read' command.  For
 
608
example, let us suppose db.example.com looks like this:
 
609
 
 
610
<pre>
 
611
/origin foo.example.com.
 
612
% TXT 'Foomatic!'
 
613
/read foo
 
614
% MX 10 mail.foo.example.com.
 
615
</pre>
 
616
 
 
617
And the file foo looks like this:
 
618
 
 
619
<pre>
 
620
% 10.1.2.3
 
621
/origin mail.%
 
622
% 10.3.2.1
 
623
</pre>
 
624
 
 
625
Then the following records will be created:
 
626
 
 
627
<pre>
 
628
foo.example.com.      TXT   'Foomatic!'
 
629
foo.example.com.      A     10.1.2.3
 
630
mail.foo.example.com. A     10.3.2.1
 
631
mail.foo.example.com. MX 10 mail.foo.example.com.
 
632
</pre>
 
633
 
 
634
To have something that works like '$INCLUDE filename' in a RFC1035
 
635
master file, do the following:
 
636
 
 
637
<pre>
 
638
/opush %
 
639
/read filename
 
640
/opop
 
641
</pre>
 
642
 
 
643
Or, for that matter, the equivalent of '$INCLUDE filename neworigin':
 
644
 
 
645
<pre>
 
646
/opush neworigin.
 
647
/read filename
 
648
/opop
 
649
</pre>
243
650
 
244
651
<h1>EXAMPLE ZONE FILE</h1>
245
652