Add "passup" and "parent" options to the DNS config, to allow forwarding
authorGeoffrey Thomas <geofft@mit.edu>
Sun, 24 Aug 2008 10:44:33 +0000 (06:44 -0400)
committerGeoffrey Thomas <geofft@mit.edu>
Sun, 24 Aug 2008 10:44:33 +0000 (06:44 -0400)
certain names as CNAME to a parent domain. This was implemented for the Vista
activation server SRV record, but can be used to pass on any well-known
reserved names.

svn path=/trunk/packages/sipb-xen-dns/; revision=913

code/dnsserver.py

index 7a7cf22..ee18cca 100755 (executable)
@@ -85,6 +85,12 @@ class DatabaseAuthority(common.ResolverBase):
                     results.append(dns.RRHeader(domain, dns.SOA, dns.IN,
                                                 ttl, self.soa, auth=True))
             else:
+                if 'passup' in dir(config.dns) and host in config.dns.passup:
+                    record = dns.Record_CNAME('%s.%s' % (host, config.dns.parent), ttl)
+                    return defer.succeed((
+                        [dns.RRHeader(name, dns.CNAME, dns.IN, ttl, record, auth=True)],
+                        [], []))
+
                 if host:
                     value = invirt.database.Machine.get_by(name=host)
                     if value is None or not value.nics: