bin/pvl.hosts-dns
changeset 289 b316deddf746
parent 283 951e4b70bad4
child 296 9dad6914cfe7
--- a/bin/pvl.hosts-dns	Mon Dec 16 21:15:25 2013 +0200
+++ b/bin/pvl.hosts-dns	Mon Dec 16 21:15:42 2013 +0200
@@ -4,6 +4,7 @@
 import pvl.hosts
 import pvl.dns.zone
 
+import fnmatch
 import ipaddr
 import logging; log = logging.getLogger('pvl.hosts-dns')
 import optparse
@@ -14,7 +15,15 @@
     """
 
     for host in hosts :
-        if options.forward_zone and host.domain != domain :
+        if not options.forward_zone :
+            pass
+        elif host.domain == domain :
+            pass
+        elif pvl.dns.zone.join('*', host.domain) == domain :
+            pass
+        elif fnmatch.fnmatch(host.domain, domain) :
+            pass
+        else :
             continue
         
         if host.ip :