MCPcopy Create free account
hub / github.com/rthalley/dnspython / AXFRNanoNameserver

Class AXFRNanoNameserver

tests/test_query.py:351–378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

349
350
351class AXFRNanoNameserver(Server):
352 def handle(self, request):
353 self.zone = dns.zone.from_text(axfr_zone, origin=self.origin)
354 self.origin = self.zone.origin
355 items = []
356 soa = self.zone.find_rrset(dns.name.empty, dns.rdatatype.SOA)
357 response = dns.message.make_response(request.message)
358 response.flags |= dns.flags.AA
359 response.answer.append(soa)
360 items.append(response)
361 response = dns.message.make_response(request.message)
362 response.question = []
363 response.flags |= dns.flags.AA
364 for name, rdataset in self.zone.iterate_rdatasets():
365 if rdataset.rdtype == dns.rdatatype.SOA and name == dns.name.empty:
366 continue
367 rrset = dns.rrset.RRset(
368 name, rdataset.rdclass, rdataset.rdtype, rdataset.covers
369 )
370 rrset.update(rdataset)
371 response.answer.append(rrset)
372 items.append(response)
373 response = dns.message.make_response(request.message)
374 response.question = []
375 response.flags |= dns.flags.AA
376 response.answer.append(soa)
377 items.append(response)
378 return items
379
380
381ixfr_message = """id 12345

Callers 4

test_axfrMethod · 0.85
test_axfr_tsigMethod · 0.85
test_axfr_root_tsigMethod · 0.85
badMethod · 0.85

Calls

no outgoing calls

Tested by 4

test_axfrMethod · 0.68
test_axfr_tsigMethod · 0.68
test_axfr_root_tsigMethod · 0.68
badMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…