fix: dont refuse ixfr and soa queries

This commit is contained in:
s3lph 2023-04-04 22:01:48 +02:00
parent 6c27d799e3
commit 625088abcf
3 changed files with 18 additions and 3 deletions

View file

@ -1,5 +1,18 @@
# EasyWKS Changelog
<!-- BEGIN RELEASE v0.4.1 -->
## Version 0.4.1
Bugfix release
### Changes
<!-- BEGIN CHANGES 0.4.1 -->
- Don't refuse DNS IXFRs and respond with full AXFR
<!-- END CHANGES 0.4.1-->
<!-- END RELEASE v0.4.1 -->
<!-- BEGIN RELEASE v0.4.0 -->
## Version 0.4.0

View file

@ -1,2 +1,2 @@
__version__ = '0.4.0'
__version__ = '0.4.1'

View file

@ -62,10 +62,12 @@ class DnsServer(common.ResolverBase):
]
def _lookup(self, name, cls, type, timeout):
if type != dns.AXFR:
return defer.fail(failure.Failure(error.DNSQueryRefusedError(name)))
if name not in self.zones:
return defer.fail(failure.Failure(dns.AuthoritativeDomainError(name)))
if type == dns.SOA or type == dns.OPT:
return defer.succeed(([self._make_soa(name)], [], []))
if type != dns.AXFR and type != dns.IXFR:
return defer.fail(failure.Failure(error.DNSQueryRefusedError(name)))
domain = self.zones[name]
results = []
soa = self._make_soa(name)