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

Method handle

tests/test_resolver.py:1086–1101  ·  view source on GitHub ↗
(self, request)

Source from the content-addressed store, hash-verified

1084
1085class AlwaysNXDOMAINNanoNameserver(Server):
1086 def handle(self, request):
1087 response = dns.message.make_response(request.message)
1088 response.set_rcode(dns.rcode.NXDOMAIN)
1089 response.flags |= dns.flags.RA
1090 origin = dns.name.from_text("example.")
1091 soa_rrset = response.find_rrset(
1092 response.authority,
1093 origin,
1094 dns.rdataclass.IN,
1095 dns.rdatatype.SOA,
1096 create=True,
1097 )
1098 rdata = dns.rdata.from_text("IN", "SOA", "ns.example. root.example. 1 2 3 4 5")
1099 soa_rrset.add(rdata)
1100 soa_rrset.update_ttl(300)
1101 return response
1102
1103
1104class AlwaysNoErrorNoDataNanoNameserver(Server):

Callers

nothing calls this directly

Calls 5

set_rcodeMethod · 0.80
from_textMethod · 0.45
find_rrsetMethod · 0.45
addMethod · 0.45
update_ttlMethod · 0.45

Tested by

no test coverage detected