README
changeset 514 f19d86b20f24
parent 512 dafac309813e
child 516 9615ffc647a0
--- a/README	Thu Feb 26 18:32:32 2015 +0200
+++ b/README	Thu Feb 26 18:42:43 2015 +0200
@@ -42,25 +42,49 @@
         fixed-address 192.0.2.2;
     }
 
-=== Includes ===
+=== Include directories ===
 Host configs can be included:
 
-    $ cat etc/hosts/includes.test
-    include = includes.test.d/
+    $ cat etc/hosts/test/test
+    include = test.d/
 
-    [quux]
-        ip  = 192.0.2.3
-
-    $ cat etc/hosts/includes.test.d/foo 
+    $ cat etc/hosts/test/test.d/foo 
     ip = 192.0.2.1
 
-    $ cat etc/hosts/includes.test.d/bar 
+    $ cat etc/hosts/test/test.d/bar 
     ip = 192.0.2.2
 
-    $ ./opt/bin/python bin/pvl.hosts-forward --forward-zone test etc/hosts/includes.test
-    foo.includes                      A     192.0.2.1
-    bar.includes                      A     192.0.2.2
-    quux.includes                     A     192.0.2.3
+    $ bin/pvl.hosts-forward --forward-zone test etc/hosts/test/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 --forward-zone test 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 
+    include = wrong.d/
+    
+    $ etc/hosts/wrong.d/host
+    [host]
+        ip  = 192.0.2.6
+
+    $ bin/pvl.hosts-forward --forward-zone test etc/hosts/wrong.test 
+    host.host.wrong                   A     192.0.2.6
 
 === Host aliases ===
 Hosts can specify DNS aliases: