From: Geoffrey Thomas Date: Sun, 24 Aug 2008 10:44:33 +0000 (-0400) Subject: Add "passup" and "parent" options to the DNS config, to allow forwarding X-Git-Tag: sipb-xen-dns/1.05~3 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-dns.git/commitdiff_plain/cfad04ef8af8968e925b6f68216898b086cbbc92 Add "passup" and "parent" options to the DNS config, to allow forwarding 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 --- diff --git a/code/dnsserver.py b/code/dnsserver.py index 7a7cf22..ee18cca 100755 --- a/code/dnsserver.py +++ b/code/dnsserver.py @@ -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: