Include TXT records in ANY queries
[invirt/packages/invirt-dns.git] / invirt-dns
index 7a39f0f..b540ff7 100755 (executable)
@@ -135,6 +135,7 @@ class DatabaseAuthority(common.ResolverBase):
             if value:
                 if other:
                     ip = value.other_ip
+                    action = value.other_action
                 else:
                     ip = value.ip
             else:
@@ -142,6 +143,7 @@ class DatabaseAuthority(common.ResolverBase):
                 if value:
                     if other:
                         ip = value.nics[0].other_ip
+                        action = value.nics[0].other_action
                     else:
                         ip = value.nics[0].ip
                 else:
@@ -152,7 +154,11 @@ class DatabaseAuthority(common.ResolverBase):
                 record = dns.Record_A(ip, ttl)
                 results.append(dns.RRHeader(name, dns.A, dns.IN,
                                             ttl, record, auth=True))
-            elif type == dns.SOA:
+            if other and type in (dns.TXT, dns.ALL_RECORDS):
+                record = dns.Record_TXT(action if action else '', ttl=ttl)
+                results.append(dns.RRHeader(name, dns.TXT, dns.IN,
+                                            ttl, record, auth=True))
+            if type == dns.SOA:
                 results.append(dns.RRHeader(domain, dns.SOA, dns.IN,
                                             ttl, self.soa, auth=True))