Index: /trunk/DNSDB/ExportBIND.pm
===================================================================
--- /trunk/DNSDB/ExportBIND.pm	(revision 847)
+++ /trunk/DNSDB/ExportBIND.pm	(revision 848)
@@ -30,5 +30,29 @@
   my $dbh = $self->{dbh};
 
-}
+  # allow for future exports of subgroups of records
+  my $viewlist = $dnsdb->getLocList(curgroup => 1);
+
+  # Write the view list to a configuration fragment
+  if ($viewlist) {
+    foreach my $view (@{$viewlist}) {
+#print Dumper($view);
+#      print BINDCONF "view $view->{location} {\n";
+      print "view $view->{location} {\n";
+      # could also use an acl { ... }; statement, then match-clients { aclname; };, but that gets hairy
+      # note that some semantics of data visibility need to be handled by the record export, since it's
+      # not 100% clear if the semantics of a tinydns view with an empty IP list (matches anyone) are the
+      # same as a BIND view with match-clients { any; };
+      if ($view->{iplist}) {
+#         print BINDCONF "  match-clients { ".join("; ", $view->iplist)."; };\n";
+         print "  match-clients { ".join("; ", split(/[\s,]+/, $view->{iplist}))."; };\n";
+      } else {
+#         print BINDCONF "  match-clients { any; };\n"
+         print "  match-clients { any; };\n"
+      }
+      print "};\n\n";
+    } # foreach @$viewlist
+  } # if $viewlist
+
+} # export()
 
 1;
