README
changeset 521 06792c78067e
parent 520 0310e199435a
child 522 6bc714379a13
--- a/README	Thu Feb 26 19:16:25 2015 +0200
+++ b/README	Thu Feb 26 19:26:15 2015 +0200
@@ -45,35 +45,19 @@
 === Include directories ===
 Host configs can be included:
 
-    $ cat etc/hosts/test/test
+    $ cat etc/hosts/test
     include = test.d/
 
-    $ cat etc/hosts/test/test.d/foo 
+    $ cat etc/hosts/test.d/foo 
     ip = 192.0.2.1
 
-    $ cat etc/hosts/test/test.d/bar 
+    $ cat etc/hosts/test.d/bar 
     ip = 192.0.2.2
 
-    $ bin/pvl.hosts-forward etc/hosts/test/test
+    $ bin/pvl.hosts-forward etc/hosts/test
     foo                               A     192.0.2.1
     bar                               A     192.0.2.2
 
-And an entire directory of hosts-files, containing sub-domains, can be given:
-
-    $ ls etc/hosts/test/
-    asdf.test  test  test.d
-
-    $ cat etc/hosts/test/asdf.test 
-    [quux]
-        ip  = 192.0.2.5
-
-    $ bin/pvl.hosts-forward etc/hosts/test/
-    foo                               A     192.0.2.1
-    bar                               A     192.0.2.2
-    quux.asdf                         A     192.0.2.5
-
-Note that the (include) directory name itself is NOT treated as a domain name. However, the file names which are included are.
-
 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:
 
     $ cat etc/hosts/wrong.test 
@@ -198,3 +182,34 @@
         fixed-address 10.2.0.1;
     }
 
+== Host structure ==
+
+Creating a tree of symlinks for managing split zonefile domains can be useful:
+
+    $ tree etc/zones/
+    etc/zones/
+    ├── forward
+    │   └── test
+    │       ├── asdf.test -> ../../../hosts/asdf.test
+    │       └── test -> ../../../hosts/test
+    └── reverse
+        └── 192.0.2
+            ├── asdf.test -> ../../../hosts/asdf.test
+            └── test -> ../../../hosts/test
+
+Given a structure like above, the `pvl.hosts-forward` can generate a single forward zone containing all sub-domains:
+
+    $ bin/pvl.hosts-forward --hosts-include etc/hosts/ etc/zones/forward/test/
+    foo                               A     192.0.2.1
+    bar                               A     192.0.2.2
+    quux.asdf                         A     192.0.2.5
+
+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/`).
+
+The same trick also works for `pvl.hosts-reverse`:
+
+    $ bin/pvl.hosts-reverse --hosts-include etc/hosts/ etc/zones/reverse/192.0.2/
+    1                                 PTR   foo.test.
+    2                                 PTR   bar.test.
+    5                                 PTR   quux.asdf.test.
+