README.md
author Tero Marttila <tero.marttila@aalto.fi>
Fri, 27 Feb 2015 18:07:32 +0200
branch0.8
changeset 654 8069b08e90ac
parent 646 585fe8171ac6
child 705 c399ca928704
child 724 68abad09d54b
permissions -rw-r--r--
bin/update: fixup relative/absolute paths
634
8ec17e8d16c0 fixup README markdown
Tero Marttila <terom@paivola.fi>
parents: 626
diff changeset
     1
# pvl-hosts
556
Tero Marttila <terom@paivola.fi>
parents:
diff changeset
     2
443
Tero Marttila <tero.marttila@aalto.fi>
parents: 438
diff changeset
     3
DNS/DHCP hosts management/integration for ISC bind9 and dhcpd.
556
Tero Marttila <terom@paivola.fi>
parents:
diff changeset
     4
634
8ec17e8d16c0 fixup README markdown
Tero Marttila <terom@paivola.fi>
parents: 626
diff changeset
     5
## Hosts
512
dafac309813e README: update to use example.com 192.0.2.0/24
Tero Marttila <tero.marttila@aalto.fi>
parents: 509
diff changeset
     6
The `pvl.hosts-*` tools read hosts files as input, which have an ini format, using section names as hostnames to configure attributes for that host:
443
Tero Marttila <tero.marttila@aalto.fi>
parents: 438
diff changeset
     7
Tero Marttila <tero.marttila@aalto.fi>
parents: 438
diff changeset
     8
    [foo]
512
dafac309813e README: update to use example.com 192.0.2.0/24
Tero Marttila <tero.marttila@aalto.fi>
parents: 509
diff changeset
     9
        ip          = 192.0.2.1
452
d10f2b2188bb README etc/hosts/test with ethernet and pvl.hosts-dhcp output
Tero Marttila <tero.marttila@aalto.fi>
parents: 448
diff changeset
    10
        ethernet    = 00:11:22:33:44:55
443
Tero Marttila <tero.marttila@aalto.fi>
parents: 438
diff changeset
    11
Tero Marttila <tero.marttila@aalto.fi>
parents: 438
diff changeset
    12
    [bar]
512
dafac309813e README: update to use example.com 192.0.2.0/24
Tero Marttila <tero.marttila@aalto.fi>
parents: 509
diff changeset
    13
        ip          = 192.0.2.2
452
d10f2b2188bb README etc/hosts/test with ethernet and pvl.hosts-dhcp output
Tero Marttila <tero.marttila@aalto.fi>
parents: 448
diff changeset
    14
        ethernet    = 01:23:45:67:89:ab
443
Tero Marttila <tero.marttila@aalto.fi>
parents: 438
diff changeset
    15
520
0310e199435a README: fixup --zone-prefix=
Tero Marttila <tero.marttila@aalto.fi>
parents: 516
diff changeset
    16
The domain name for a host is determined from the basename of the config file, so this example file would generate something like the following output for use in a `zone "example.com" { ... }` zonefile:
512
dafac309813e README: update to use example.com 192.0.2.0/24
Tero Marttila <tero.marttila@aalto.fi>
parents: 509
diff changeset
    17
    
516
9615ffc647a0 pvl.hosts-forward: if only a single hosts file/dir is given, use it as the --zone-origin; support --root-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 514
diff changeset
    18
    $ bin/pvl.hosts-forward etc/hosts/example.com 
512
dafac309813e README: update to use example.com 192.0.2.0/24
Tero Marttila <tero.marttila@aalto.fi>
parents: 509
diff changeset
    19
    foo                               A     192.0.2.1
dafac309813e README: update to use example.com 192.0.2.0/24
Tero Marttila <tero.marttila@aalto.fi>
parents: 509
diff changeset
    20
    bar                               A     192.0.2.2
443
Tero Marttila <tero.marttila@aalto.fi>
parents: 438
diff changeset
    21
520
0310e199435a README: fixup --zone-prefix=
Tero Marttila <tero.marttila@aalto.fi>
parents: 516
diff changeset
    22
And correspondingly, the reverse zone for `2.0.192.in-addr.arpa`:
443
Tero Marttila <tero.marttila@aalto.fi>
parents: 438
diff changeset
    23
520
0310e199435a README: fixup --zone-prefix=
Tero Marttila <tero.marttila@aalto.fi>
parents: 516
diff changeset
    24
    $ bin/pvl.hosts-reverse --zone-prefix=192.0.2.0/24 etc/hosts/example.com
512
dafac309813e README: update to use example.com 192.0.2.0/24
Tero Marttila <tero.marttila@aalto.fi>
parents: 509
diff changeset
    25
    1                                 PTR   foo.example.com.
dafac309813e README: update to use example.com 192.0.2.0/24
Tero Marttila <tero.marttila@aalto.fi>
parents: 509
diff changeset
    26
    2                                 PTR   bar.example.com.
443
Tero Marttila <tero.marttila@aalto.fi>
parents: 438
diff changeset
    27
452
d10f2b2188bb README etc/hosts/test with ethernet and pvl.hosts-dhcp output
Tero Marttila <tero.marttila@aalto.fi>
parents: 448
diff changeset
    28
And the associated DHCP hosts:
d10f2b2188bb README etc/hosts/test with ethernet and pvl.hosts-dhcp output
Tero Marttila <tero.marttila@aalto.fi>
parents: 448
diff changeset
    29
512
dafac309813e README: update to use example.com 192.0.2.0/24
Tero Marttila <tero.marttila@aalto.fi>
parents: 509
diff changeset
    30
    $ bin/pvl.hosts-dhcp etc/hosts/example.com 
452
d10f2b2188bb README etc/hosts/test with ethernet and pvl.hosts-dhcp output
Tero Marttila <tero.marttila@aalto.fi>
parents: 448
diff changeset
    31
    host foo {
480
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
    32
        option host-name foo;
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
    33
        hardware ethernet 00:11:22:33:44:55;
512
dafac309813e README: update to use example.com 192.0.2.0/24
Tero Marttila <tero.marttila@aalto.fi>
parents: 509
diff changeset
    34
        fixed-address 192.0.2.1;
452
d10f2b2188bb README etc/hosts/test with ethernet and pvl.hosts-dhcp output
Tero Marttila <tero.marttila@aalto.fi>
parents: 448
diff changeset
    35
    }
d10f2b2188bb README etc/hosts/test with ethernet and pvl.hosts-dhcp output
Tero Marttila <tero.marttila@aalto.fi>
parents: 448
diff changeset
    36
d10f2b2188bb README etc/hosts/test with ethernet and pvl.hosts-dhcp output
Tero Marttila <tero.marttila@aalto.fi>
parents: 448
diff changeset
    37
    host bar {
480
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
    38
        option host-name bar;
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
    39
        hardware ethernet 01:23:45:67:89:ab;
512
dafac309813e README: update to use example.com 192.0.2.0/24
Tero Marttila <tero.marttila@aalto.fi>
parents: 509
diff changeset
    40
        fixed-address 192.0.2.2;
452
d10f2b2188bb README etc/hosts/test with ethernet and pvl.hosts-dhcp output
Tero Marttila <tero.marttila@aalto.fi>
parents: 448
diff changeset
    41
    }
d10f2b2188bb README etc/hosts/test with ethernet and pvl.hosts-dhcp output
Tero Marttila <tero.marttila@aalto.fi>
parents: 448
diff changeset
    42
634
8ec17e8d16c0 fixup README markdown
Tero Marttila <terom@paivola.fi>
parents: 626
diff changeset
    43
### Include directories
507
e3a32f4dff54 pvl.hosts.config: document includes, fix include-only zone, and test
Tero Marttila <tero.marttila@aalto.fi>
parents: 484
diff changeset
    44
Host configs can be included:
e3a32f4dff54 pvl.hosts.config: document includes, fix include-only zone, and test
Tero Marttila <tero.marttila@aalto.fi>
parents: 484
diff changeset
    45
521
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
    46
    $ cat etc/hosts/test
514
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    47
    include = test.d/
507
e3a32f4dff54 pvl.hosts.config: document includes, fix include-only zone, and test
Tero Marttila <tero.marttila@aalto.fi>
parents: 484
diff changeset
    48
521
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
    49
    $ cat etc/hosts/test.d/foo 
507
e3a32f4dff54 pvl.hosts.config: document includes, fix include-only zone, and test
Tero Marttila <tero.marttila@aalto.fi>
parents: 484
diff changeset
    50
    ip = 192.0.2.1
e3a32f4dff54 pvl.hosts.config: document includes, fix include-only zone, and test
Tero Marttila <tero.marttila@aalto.fi>
parents: 484
diff changeset
    51
521
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
    52
    $ cat etc/hosts/test.d/bar 
507
e3a32f4dff54 pvl.hosts.config: document includes, fix include-only zone, and test
Tero Marttila <tero.marttila@aalto.fi>
parents: 484
diff changeset
    53
    ip = 192.0.2.2
e3a32f4dff54 pvl.hosts.config: document includes, fix include-only zone, and test
Tero Marttila <tero.marttila@aalto.fi>
parents: 484
diff changeset
    54
521
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
    55
    $ bin/pvl.hosts-forward etc/hosts/test
514
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    56
    foo                               A     192.0.2.1
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    57
    bar                               A     192.0.2.2
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    58
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    59
Including a directory of files is equivalent to substituiting each file as a named section at the level of the include = statement. Note that this means that included files are treated directly as host definitions, IOW, you should NOT include a section name in an included host file unless you want to declare an additional subdomain:
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    60
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    61
    $ cat etc/hosts/wrong.test 
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    62
    include = wrong.d/
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    63
    
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    64
    $ etc/hosts/wrong.d/host
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    65
    [host]
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    66
        ip  = 192.0.2.6
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    67
516
9615ffc647a0 pvl.hosts-forward: if only a single hosts file/dir is given, use it as the --zone-origin; support --root-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 514
diff changeset
    68
Using the --root-zone option to generate the full FQDN for the host:
9615ffc647a0 pvl.hosts-forward: if only a single hosts file/dir is given, use it as the --zone-origin; support --root-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 514
diff changeset
    69
9615ffc647a0 pvl.hosts-forward: if only a single hosts file/dir is given, use it as the --zone-origin; support --root-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 514
diff changeset
    70
    $ bin/pvl.hosts-forward --root-zone etc/hosts/wrong.test 
9615ffc647a0 pvl.hosts-forward: if only a single hosts file/dir is given, use it as the --zone-origin; support --root-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 514
diff changeset
    71
    host.host.wrong.test              A     192.0.2.6
507
e3a32f4dff54 pvl.hosts.config: document includes, fix include-only zone, and test
Tero Marttila <tero.marttila@aalto.fi>
parents: 484
diff changeset
    72
634
8ec17e8d16c0 fixup README markdown
Tero Marttila <terom@paivola.fi>
parents: 626
diff changeset
    73
### Host aliases
484
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    74
Hosts can specify DNS aliases:
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    75
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    76
    [foo]
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    77
        ip          = 127.0.0.1
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    78
        alias       = test1
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    79
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    80
    [bar]
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    81
        ip          = 127.0.0.2
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    82
        alias       = test2
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    83
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    84
    $ bin/pvl.hosts-forward --forward-zone alias.test etc/hosts/alias.test 
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    85
    foo                               A     127.0.0.1
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    86
    test1                             CNAME foo
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    87
    bar                               A     127.0.0.2
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    88
    test2                             CNAME bar
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    89
634
8ec17e8d16c0 fixup README markdown
Tero Marttila <terom@paivola.fi>
parents: 626
diff changeset
    90
### Generated hosts
447
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
    91
The hosts file format supports something similar to bind9's $GENERATE directive for hosts:
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
    92
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
    93
    [asdf{1-3}]
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
    94
        ip  = 10.100.100.$
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
    95
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
    96
    $ bin/pvl.hosts-dns --forward-zone=asdf etc/hosts/asdf 
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
    97
    asdf1@asdf                        A     10.100.100.1
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
    98
    asdf2@asdf                        A     10.100.100.2
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
    99
    asdf3@asdf                        A     10.100.100.3
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
   100
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
   101
Note that the generate directives are interpreted and compiled directly by pvl.hosts. 
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
   102
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
   103
Most of the $GENERATE options should be supported, with a little clever hackery:
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
   104
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
   105
    [asdf{1-5/2}{0,2}]
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
   106
       ip  = 10.100.100.$${10}
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
   107
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
   108
    $ bin/pvl.hosts-dns --forward-zone=asdf2 etc/hosts/asdf2
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
   109
    asdf01@asdf2                      A     10.100.100.11
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
   110
    asdf03@asdf2                      A     10.100.100.13
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
   111
    asdf05@asdf2                      A     10.100.100.15
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
   112
448
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   113
This feature can be used for generating reverse delegations:
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   114
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   115
    [foo-{240-247}]
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   116
        forward =
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   117
        reverse = $.240/29.0.0.10.in-addr.arpa
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   118
        ip      = 10.0.0.$
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   119
    
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   120
    $ bin/pvl.hosts-dns --reverse-zone=10 etc/hosts/reverse 
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   121
    240.0.0                           CNAME 240.240/29.0.0.10.in-addr.arpa.
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   122
    241.0.0                           CNAME 241.240/29.0.0.10.in-addr.arpa.
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   123
    242.0.0                           CNAME 242.240/29.0.0.10.in-addr.arpa.
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   124
    243.0.0                           CNAME 243.240/29.0.0.10.in-addr.arpa.
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   125
    244.0.0                           CNAME 244.240/29.0.0.10.in-addr.arpa.
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   126
    245.0.0                           CNAME 245.240/29.0.0.10.in-addr.arpa.
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   127
    246.0.0                           CNAME 246.240/29.0.0.10.in-addr.arpa.
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   128
    247.0.0                           CNAME 247.240/29.0.0.10.in-addr.arpa.
480
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   129
634
8ec17e8d16c0 fixup README markdown
Tero Marttila <terom@paivola.fi>
parents: 626
diff changeset
   130
### DHCP Options
480
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   131
The hosts need not specify any fixed ip address, leaving IP address allocation to dhcpd:
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   132
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   133
    [foo]
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   134
        ethernet    = 00:11:22:33:44:55 
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   135
    
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   136
    $ bin/pvl.hosts-dhcp etc/hosts/dhcp1 
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   137
    host foo {
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   138
        option host-name foo;
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   139
        hardware ethernet 00:11:22:33:44:55;
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   140
    }
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   141
634
8ec17e8d16c0 fixup README markdown
Tero Marttila <terom@paivola.fi>
parents: 626
diff changeset
   142
### DHCP Boot options
480
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   143
The hosts can specify DHCP boot server/file options:
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   144
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   145
    [foo]
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   146
        ethernet    = 00:11:22:33:44:55
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   147
        boot        = boot.lan:debian/wheezy/pxelinux.0
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   148
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   149
    $ bin/pvl.hosts-dhcp etc/hosts/boot.dhcp 
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   150
    host foo {
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   151
        option host-name foo;
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   152
        hardware ethernet 00:11:22:33:44:55;
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   153
        next-server boot.lan;
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   154
        filename debian/wheezy/pxelinux.0;
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   155
    }
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   156
634
8ec17e8d16c0 fixup README markdown
Tero Marttila <terom@paivola.fi>
parents: 626
diff changeset
   157
### DHCP hosts in multiple subnets/domains
483
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   158
A host with different interfaces in multiple domains must specify unique interface names:
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   159
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   160
    [foo.dhcp]
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   161
        [[asdf]]
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   162
            ip              = 10.1.0.1
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   163
            ethernet.eth1   = 00:11:22:33:44:55
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   164
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   165
    [bar.dhcp]
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   166
        [[asdf]]
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   167
            ip              = 10.2.0.1
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   168
            ethernet.eth2   = 55:44:33:22:11:00
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   169
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   170
    $ bin/pvl.hosts-dhcp etc/hosts/dhcp2 
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   171
    host asdf-eth1 {
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   172
        option host-name asdf;
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   173
        hardware ethernet 00:11:22:33:44:55;
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   174
        fixed-address 10.1.0.1;
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   175
    }
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   176
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   177
    host asdf-eth2 {
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   178
        option host-name asdf;
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   179
        hardware ethernet 55:44:33:22:11:00;
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   180
        fixed-address 10.2.0.1;
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   181
    }
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   182
634
8ec17e8d16c0 fixup README markdown
Tero Marttila <terom@paivola.fi>
parents: 626
diff changeset
   183
# `update`
626
5cd99761fe4d merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
parents: 522 601
diff changeset
   184
A script to drive the *pvl.hosts* tools for maintaing a set of zone/host files for a DNS/DHCP server.
5cd99761fe4d merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
parents: 522 601
diff changeset
   185
634
8ec17e8d16c0 fixup README markdown
Tero Marttila <terom@paivola.fi>
parents: 626
diff changeset
   186
## Source host files
521
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   187
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   188
Creating a tree of symlinks for managing split zonefile domains can be useful:
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   189
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   190
    $ tree etc/zones/
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   191
    etc/zones/
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   192
    ├── forward
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   193
    │   └── test
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   194
    │       ├── asdf.test -> ../../../hosts/asdf.test
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   195
    │       └── test -> ../../../hosts/test
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   196
    └── reverse
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   197
        └── 192.0.2
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   198
            ├── asdf.test -> ../../../hosts/asdf.test
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   199
            └── test -> ../../../hosts/test
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   200
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   201
Given a structure like above, the `pvl.hosts-forward` can generate a single forward zone containing all sub-domains:
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   202
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   203
    $ bin/pvl.hosts-forward --hosts-include etc/hosts/ etc/zones/forward/test/
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   204
    foo                               A     192.0.2.1
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   205
    bar                               A     192.0.2.2
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   206
    quux.asdf                         A     192.0.2.5
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   207
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   208
Note that the directory name is treated separately as a zone origin; the file names within the domain are still treated as a flat namespace independent of the directory name (which is different than *pvl.hosts* would behave for `include = etc/zones/forward/test/`).
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   209
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   210
The same trick also works for `pvl.hosts-reverse`:
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   211
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   212
    $ bin/pvl.hosts-reverse --hosts-include etc/hosts/ etc/zones/reverse/192.0.2/
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   213
    1                                 PTR   foo.test.
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   214
    2                                 PTR   bar.test.
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   215
    5                                 PTR   quux.asdf.test.
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   216
645
Tero Marttila <tero.marttila@aalto.fi>
parents: 644
diff changeset
   217
## Source zone files
Tero Marttila <tero.marttila@aalto.fi>
parents: 644
diff changeset
   218
Tero Marttila <tero.marttila@aalto.fi>
parents: 644
diff changeset
   219
The zonefile header should be written out manually, using an `$INCLUDE` directive to reference the (generated) hosts zonefile:
Tero Marttila <tero.marttila@aalto.fi>
parents: 644
diff changeset
   220
Tero Marttila <tero.marttila@aalto.fi>
parents: 644
diff changeset
   221
    $ cat etc/zones/test 
Tero Marttila <tero.marttila@aalto.fi>
parents: 644
diff changeset
   222
    $TTL 3600
Tero Marttila <tero.marttila@aalto.fi>
parents: 644
diff changeset
   223
Tero Marttila <tero.marttila@aalto.fi>
parents: 644
diff changeset
   224
    @                   SOA     foo.test. hostmaster.test. (
Tero Marttila <tero.marttila@aalto.fi>
parents: 644
diff changeset
   225
                                0               ; serial
Tero Marttila <tero.marttila@aalto.fi>
parents: 644
diff changeset
   226
                                1d              ; refresh
Tero Marttila <tero.marttila@aalto.fi>
parents: 644
diff changeset
   227
                                5m              ; retry
Tero Marttila <tero.marttila@aalto.fi>
parents: 644
diff changeset
   228
                                10d             ; expiry
Tero Marttila <tero.marttila@aalto.fi>
parents: 644
diff changeset
   229
                                300             ; negative
Tero Marttila <tero.marttila@aalto.fi>
parents: 644
diff changeset
   230
                        )
Tero Marttila <tero.marttila@aalto.fi>
parents: 644
diff changeset
   231
Tero Marttila <tero.marttila@aalto.fi>
parents: 644
diff changeset
   232
                        NS      foo
Tero Marttila <tero.marttila@aalto.fi>
parents: 644
diff changeset
   233
                        NS      bar
Tero Marttila <tero.marttila@aalto.fi>
parents: 644
diff changeset
   234
Tero Marttila <tero.marttila@aalto.fi>
parents: 644
diff changeset
   235
    $INCLUDE "forward/test"
Tero Marttila <tero.marttila@aalto.fi>
parents: 644
diff changeset
   236
646
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   237
## Operation
557
d2e187c1f548 README: update opts
Tero Marttila <terom@paivola.fi>
parents: 556
diff changeset
   238
646
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   239
Use the *update* script to generate a complete set of output zonefiles:
557
d2e187c1f548 README: update opts
Tero Marttila <terom@paivola.fi>
parents: 556
diff changeset
   240
646
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   241
    $ ./bin/update
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   242
    Commit...
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   243
    Using commit timestamp: 1425049508
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   244
    Updating forward host zones...
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   245
      var/zones/forward/test: Generating forward hosts zone: etc/zones/forward/test/
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   246
    Updating reverse host zones...
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   247
      var/zones/reverse/192.0.2: Generating reverse hosts zone: etc/zones/reverse/192.0.2/
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   248
    Updating DHCP hosts...
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   249
    Copying zone includes...
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   250
    Updating zones...
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   251
      var/serials/test: Update serial: 1425049508 <- 1425049508
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   252
      var/zones/test: Generate zone: etc/zones/test
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   253
    Updating DHCP confs...
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   254
    Testing zones...
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   255
    Reload zones...
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   256
      Reload zones
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   257
            rndc: server reload successful
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   258
    Testing DHCP...
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   259
    Reload DHCP...
557
d2e187c1f548 README: update opts
Tero Marttila <terom@paivola.fi>
parents: 556
diff changeset
   260
646
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   261
## Output zone files
557
d2e187c1f548 README: update opts
Tero Marttila <terom@paivola.fi>
parents: 556
diff changeset
   262
646
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   263
The generated zone files can then be loaded by bind:
556
Tero Marttila <terom@paivola.fi>
parents:
diff changeset
   264
646
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   265
    $ cat var/zones/test 
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   266
    $TTL    3600
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   267
    @                                 SOA   foo.test. hostmaster.test. 1425049508 1d 5m 10d 300
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   268
                                      NS    foo
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   269
                                      NS    bar
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   270
    $INCLUDE        "./var/zones/forward/test"
579
12e098a732ed README: docdoc
Tero Marttila <terom@paivola.fi>
parents: 557
diff changeset
   271
646
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   272
    $ cat var/zones/forward/test 
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   273
    foo                               A     192.0.2.1
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   274
    bar                               A     192.0.2.2
585fe8171ac6 README: better ./update docs
Tero Marttila <tero.marttila@aalto.fi>
parents: 645
diff changeset
   275
    quux.asdf                         A     192.0.2.5
601
5a21b5238fa9 update README
Tero Marttila <terom@paivola.fi>
parents: 579
diff changeset
   276
644
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   277
# *pvl-dns*
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   278
Low-level zonefile utilities.
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   279
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   280
## `bin/pvl.dns-process`
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   281
Process a zonefile to modify:
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   282
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   283
* `SOA` record serial
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   284
* `$INCLUDE` paths
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   285
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   286
    $ bin/pvl.dns-process --serial $(date +%s) --include-path var/zones etc/zones/test 
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   287
    $TTL    3600
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   288
    @                                 SOA   foo.test. hostmaster.test. 1425049088 1d 5m 10d 300
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   289
                                      NS    foo
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   290
                                      NS    bar
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   291
    $INCLUDE        "var/zones/forward/test"
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   292
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   293
## `bin/pvl.dns-zone`
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   294
Load a zonefile and output any ZoneRecords that it contains, including `$GENERATE`ed and `$INCLUDE`ed records:
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   295
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   296
    $ bin/pvl.dns-zone --zone=test var/zones/test 
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   297
    @                         3600    SOA   foo.test. hostmaster.test. 1425049248 1d 5m 10d 300
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   298
    @                         3600    NS    foo
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   299
    @                         3600    NS    bar
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   300
    foo                       3600    A     192.0.2.1
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   301
    bar                       3600    A     192.0.2.2
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   302
    quux.asdf                 3600    A     192.0.2.5
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   303
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   304
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   305
Optionally `--check-hosts` for dupliates `A`/`AAAA` records.
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   306
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   307
Use `--reverse-prefix=192.0.2` to generate a reverse-dns zone from `A`/`AAAA` records:
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   308
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   309
    $ bin/pvl.dns-zone --zone=test var/zones/test --reverse-prefix=192.0.2
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   310
    1                                 PTR   foo.test.
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   311
    2                                 PTR   bar.test.
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   312
    5                                 PTR   quux.asdf.test.
c51eb0151fec README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 634
diff changeset
   313
634
8ec17e8d16c0 fixup README markdown
Tero Marttila <terom@paivola.fi>
parents: 626
diff changeset
   314
# Experimental features 
601
5a21b5238fa9 update README
Tero Marttila <terom@paivola.fi>
parents: 579
diff changeset
   315
522
6bc714379a13 README: experimental features
Tero Marttila <tero.marttila@aalto.fi>
parents: 521
diff changeset
   316
Features that are still under development
601
5a21b5238fa9 update README
Tero Marttila <terom@paivola.fi>
parents: 579
diff changeset
   317
522
6bc714379a13 README: experimental features
Tero Marttila <tero.marttila@aalto.fi>
parents: 521
diff changeset
   318
* DHCP host status tracking from syslog/dhcpd.leases into a database 
6bc714379a13 README: experimental features
Tero Marttila <tero.marttila@aalto.fi>
parents: 521
diff changeset
   319
* SNMP network topology discovery