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

Method handle

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

Source from the content-addressed store, hash-verified

1103
1104class AlwaysNoErrorNoDataNanoNameserver(Server):
1105 def handle(self, request):
1106 response = dns.message.make_response(request.message)
1107 response.set_rcode(dns.rcode.NOERROR)
1108 response.flags |= dns.flags.RA
1109 origin = dns.name.from_text("example.")
1110 soa_rrset = response.find_rrset(
1111 response.authority,
1112 origin,
1113 dns.rdataclass.IN,
1114 dns.rdatatype.SOA,
1115 create=True,
1116 )
1117 rdata = dns.rdata.from_text("IN", "SOA", "ns.example. root.example. 1 2 3 4 5")
1118 soa_rrset.add(rdata)
1119 soa_rrset.update_ttl(300)
1120 return response
1121
1122
1123@unittest.skipIf(

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