From: Quentin Smith Date: Fri, 27 Feb 2009 07:56:54 +0000 (-0500) Subject: Answer all PTR requests, even if we otherwise wouldn't be authoritative X-Git-Tag: 0.0.10^0 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-dns.git/commitdiff_plain/05aa6e4bbfef0c3557b0789e1f903f6af1775fc9 Answer all PTR requests, even if we otherwise wouldn't be authoritative svn path=/trunk/packages/invirt-dns/; revision=2201 --- diff --git a/debian/changelog b/debian/changelog index 3d5360f..3b219f2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,10 @@ invirt-dns (0.0.10) unstable; urgency=low - * Add support for resolving PTR records in the in-addr.arpa zone + * Add support for resolving PTR records in the in-addr.arpa zone. + * If we're not authoritative for an in-addr.arpa zone, generate a + phantom SOA record for the exact request that came in. - -- Quentin Smith Fri, 27 Feb 2009 02:39:25 -0500 + -- Quentin Smith Fri, 27 Feb 2009 02:56:31 -0500 invirt-dns (0.0.9) unstable; urgency=low diff --git a/invirt-dns b/invirt-dns index d6d072e..9bc051f 100755 --- a/invirt-dns +++ b/invirt-dns @@ -70,7 +70,10 @@ class DatabaseAuthority(common.ResolverBase): if name.endswith('.'+domain) and len(domain) > len(best_domain): best_domain = domain if best_domain == '': - return defer.fail(failure.Failure(dns.DomainError(name))) + if name.endswith('.in-addr.arpa'): + best_domain = name # Act authoritative for the IP address for reverse resolution requests + else: + return defer.fail(failure.Failure(dns.DomainError(name))) domain = best_domain results = [] authority = [] @@ -80,7 +83,7 @@ class DatabaseAuthority(common.ResolverBase): if cls == dns.IN: host = name[:-len(domain)-1] - if not host: # Request for the domain itself. + if not host and type != dns.PTR: # Request for the domain itself. if type in (dns.A, dns.ALL_RECORDS): record = dns.Record_A(config.dns.nameservers[0].ip, ttl) results.append(dns.RRHeader(name, dns.A, dns.IN,