author | Tero Marttila <tero.marttila@aalto.fi> |
Fri, 27 Feb 2015 17:03:15 +0200 | |
changeset 644 | c51eb0151fec |
parent 634 | 8ec17e8d16c0 |
child 645 | 0467e1464cca |
permissions | -rw-r--r-- |
634 | 1 |
# pvl-hosts |
556 | 2 |
|
443 | 3 |
DNS/DHCP hosts management/integration for ISC bind9 and dhcpd. |
556 | 4 |
|
634 | 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 | 7 |
|
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 | 11 |
|
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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 183 |
# `update` |
626
5cd99761fe4d
merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
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>
diff
changeset
|
185 |
|
634 | 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 |
|
634 | 217 |
## Usage |
626
5cd99761fe4d
merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
diff
changeset
|
218 |
|
634 | 219 |
### `bin/update` |
626
5cd99761fe4d
merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
diff
changeset
|
220 |
*update* reads host/zone file sources from `etc/`, and generates zonefiles/dhcp configs under `var/`. |
5cd99761fe4d
merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
diff
changeset
|
221 |
|
5cd99761fe4d
merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
diff
changeset
|
222 |
`update` will also shows and commits changes to `etc/` in any supported version-control system, and use commit timestamps for stable zone serials. |
5cd99761fe4d
merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
diff
changeset
|
223 |
|
5cd99761fe4d
merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
diff
changeset
|
224 |
-d DIR |
5cd99761fe4d
merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
diff
changeset
|
225 |
Do data operations under given dir-root, as opposed to CWD. |
5cd99761fe4d
merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
diff
changeset
|
226 |
|
5cd99761fe4d
merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
diff
changeset
|
227 |
-q |
5cd99761fe4d
merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
diff
changeset
|
228 |
Quiet. No log messages except errors. |
5cd99761fe4d
merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
diff
changeset
|
229 |
|
5cd99761fe4d
merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
diff
changeset
|
230 |
-vDV |
5cd99761fe4d
merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
diff
changeset
|
231 |
Increasing logging verbosity. |
5cd99761fe4d
merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
diff
changeset
|
232 |
|
5cd99761fe4d
merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
diff
changeset
|
233 |
-p |
5cd99761fe4d
merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
diff
changeset
|
234 |
Show diffs for changed output on stdout. |
5cd99761fe4d
merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
diff
changeset
|
235 |
|
5cd99761fe4d
merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
diff
changeset
|
236 |
-F |
5cd99761fe4d
merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
diff
changeset
|
237 |
Force-update output files, even if newer than input files. |
5cd99761fe4d
merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
diff
changeset
|
238 |
|
5cd99761fe4d
merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
diff
changeset
|
239 |
-S |
5cd99761fe4d
merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
diff
changeset
|
240 |
Do not generate new serials for zones. |
556 | 241 |
|
579 | 242 |
-d DIR |
557 | 243 |
Do data operations under given dir-root, as opposed to CWD. |
244 |
||
245 |
-q |
|
579 | 246 |
Quiet. No log messages except errors. |
557 | 247 |
|
248 |
-vDV |
|
249 |
Increasing logging verbosity. |
|
250 |
||
251 |
-p |
|
579 | 252 |
Show diffs for changed output on stdout. |
557 | 253 |
|
254 |
-F |
|
255 |
Force-update output files, even if newer than input files. |
|
256 |
||
257 |
-S |
|
258 |
Do not generate new serials for zones. |
|
259 |
||
579 | 260 |
-s |
261 |
Generate new serials for all zones. |
|
262 |
||
557 | 263 |
-n |
264 |
Fake-update; show changes, but don't actually commit/deploy them. |
|
265 |
||
579 | 266 |
Useful for testing. |
267 |
||
557 | 268 |
-C |
269 |
Do not commit source changes. |
|
270 |
||
271 |
-c |
|
272 |
Force-commit source changes, even though -n |
|
273 |
||
579 | 274 |
-m MSG |
557 | 275 |
Commit message for source changes; optional |
276 |
||
634 | 277 |
## Output structure |
626
5cd99761fe4d
merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
diff
changeset
|
278 |
Generated file structure. |
556 | 279 |
|
634 | 280 |
### `var/dhcp/` |
626
5cd99761fe4d
merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
diff
changeset
|
281 |
Generated dhcpd.conf fragments, loaded by dhcpd. |
579 | 282 |
|
634 | 283 |
### `var/zones/` |
626
5cd99761fe4d
merge in the pvl-dns repo, with all of its history
Tero Marttila <tero.marttila@aalto.fi>
diff
changeset
|
284 |
Generated zonefiles, loaded by bind. |
601 | 285 |
|
644
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
286 |
# *pvl-dns* |
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
287 |
Low-level zonefile utilities. |
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
288 |
|
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
289 |
## `bin/pvl.dns-process` |
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
290 |
Process a zonefile to modify: |
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
291 |
|
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
292 |
* `SOA` record serial |
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
293 |
* `$INCLUDE` paths |
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
294 |
|
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
295 |
$ cat etc/zones/test |
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
296 |
$TTL 3600 |
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
297 |
|
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
298 |
@ SOA foo.test. hostmaster.test. ( |
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
299 |
0 ; serial |
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
300 |
1d ; refresh |
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
301 |
5m ; retry |
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
302 |
10d ; expiry |
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
303 |
300 ; negative |
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 |
|
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
306 |
NS foo |
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
307 |
NS bar |
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 |
$INCLUDE "forward/test" |
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
310 |
|
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
311 |
$ 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
|
312 |
$TTL 3600 |
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
313 |
@ 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
|
314 |
NS foo |
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
315 |
NS bar |
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
316 |
$INCLUDE "var/zones/forward/test" |
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
317 |
|
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
318 |
## `bin/pvl.dns-zone` |
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
319 |
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
|
320 |
|
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
321 |
$ 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
|
322 |
@ 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
|
323 |
@ 3600 NS foo |
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
324 |
@ 3600 NS bar |
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
325 |
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
|
326 |
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
|
327 |
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
|
328 |
|
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
329 |
|
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
330 |
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
|
331 |
|
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
332 |
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
|
333 |
|
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
334 |
$ 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
|
335 |
1 PTR foo.test. |
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
336 |
2 PTR bar.test. |
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
337 |
5 PTR quux.asdf.test. |
c51eb0151fec
README pvl.dns-process and pvl.dns-zone
Tero Marttila <tero.marttila@aalto.fi>
parents:
634
diff
changeset
|
338 |
|
634 | 339 |
# Experimental features |
601 | 340 |
|
522
6bc714379a13
README: experimental features
Tero Marttila <tero.marttila@aalto.fi>
parents:
521
diff
changeset
|
341 |
Features that are still under development |
601 | 342 |
|
522
6bc714379a13
README: experimental features
Tero Marttila <tero.marttila@aalto.fi>
parents:
521
diff
changeset
|
343 |
* 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
|
344 |
* SNMP network topology discovery |