[vhffs-dev] [1629] Added config examples for bind-dlz stuff

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 1629
Author:   beuss
Date:     2010-10-09 12:46:20 +0200 (Sat, 09 Oct 2010)
Log Message:
-----------
Added config examples for bind-dlz stuff

Added Paths:
-----------
    trunk/vhffs-doc/config/bind/
    trunk/vhffs-doc/config/bind/README
    trunk/vhffs-doc/config/bind/named.conf.vhffs

Added: trunk/vhffs-doc/config/bind/README
===================================================================
--- trunk/vhffs-doc/config/bind/README	                        (rev 0)
+++ trunk/vhffs-doc/config/bind/README	2010-10-09 10:46:20 UTC (rev 1629)
@@ -0,0 +1,2 @@
+For this config to work, you have to compile bind with
+--with-dlz-postgres=yes

Added: trunk/vhffs-doc/config/bind/named.conf.vhffs
===================================================================
--- trunk/vhffs-doc/config/bind/named.conf.vhffs	                        (rev 0)
+++ trunk/vhffs-doc/config/bind/named.conf.vhffs	2010-10-09 10:46:20 UTC (rev 1629)
@@ -0,0 +1,38 @@
+// This will enable bind DLZ to serve VHFFS handled domains
+
+// Queries are:
+//   - check if we handle a domain
+//   - get info for non NS/SOA records
+//   - get info for NS/SOA records
+//   - get info for all records
+//   - check if a client is allowed to do transfers (not handled by VHFFS).
+
+dlz "postgres zone" {
+   database "postgres 2
+   {host=sql port=5432 dbname=vhffs user=fillme password=fillme}
+   {select dns.domain from vhffs_dns dns inner join vhffs_object o on(o.object_id = dns.object_id) where dns.domain = '%zone%' and o.state = 6 }
+   {select rr.ttl, rr.type, case
+     when rr.type='TXT' then E'\"' || replace(replace(rr.data, E'\\', E'\\\\'), E'\"', E'\\\"') || E'\"'
+     when rr.type='MX' OR rr.type='SRV' then rr.aux || ' ' || rr.data
+     else rr.data
+     end from vhffs_dns_rr rr inner join vhffs_dns dns on (dns.dns_id = rr.zone)
+        where dns.domain = '%zone%' and name = case when '%record%'='@' then '' else '%record%' end
+        and not type != 'NS'}
+   {(select dns.ttl, 'SOA', dns.ns || ' ' || dns.mbox || ' ' || dns.serial || ' ' || dns.refresh ||
+        ' ' || dns.retry || ' ' || dns.expire || ' ' ||  dns.minimum::text
+        from vhffs_dns dns where domain = '%zone%')
+    union
+    (select rr.ttl, rr.type, rr.data from vhffs_dns_rr rr inner join vhffs_dns dns on (dns.dns_id = rr.zone)
+        where dns.domain = '%zone%' AND type = 'NS')}
+   {(select dns.ttl, 'SOA', dns.ns || ' ' || dns.mbox || ' ' || dns.serial || ' ' || dns.refresh ||
+        ' ' || dns.retry || ' ' || dns.expire || ' ' ||  dns.minimum::text
+        from vhffs_dns dns where domain = '%zone%')
+    union
+    (select rr.ttl, rr.type, case
+     when rr.type='TXT' then E'\"' || replace(replace(rr.data, E'\\', E'\\\\'), E'\"', E'\\\"') || E'\"'
+     when rr.type='MX' OR rr.type='SRV' then rr.aux || ' ' || rr.data
+     else rr.data
+     end from vhffs_dns_rr rr inner join vhffs_dns dns on (dns.dns_id = rr.zone)
+        where dns.domain = '%zone%')}
+   {select zone from xfr_table where zone = '%zone%' and client = '%client%'}";
+};


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/