]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add debug logs for outgoing DNS messages
authorMichał Kępień <michal@isc.org>
Fri, 30 May 2025 16:08:54 +0000 (18:08 +0200)
committerMichał Kępień <michal@isc.org>
Fri, 30 May 2025 16:08:54 +0000 (18:08 +0200)
Since AsyncDnsServer logs incoming DNS messages as seen on the wire, do
the same for the responses sent by the server.

bin/tests/system/isctest/asyncserver.py

index fed86f6f33c90ecdbca3b18297c1032321806ced..8f9a3c07585281ec00b465b1af30c86c517c9e91 100644 (file)
@@ -580,6 +580,7 @@ class AsyncDnsServer(AsyncServer):
         peer = Peer(addr[0], addr[1])
         responses = self._handle_query(wire, peer, DnsProtocol.UDP)
         async for response in responses:
+            logging.debug("Sending UDP message: %s", response.hex())
             transport.sendto(response, addr)
 
     async def _handle_tcp(
@@ -672,6 +673,7 @@ class AsyncDnsServer(AsyncServer):
     ) -> None:
         responses = self._handle_query(wire, peer, DnsProtocol.TCP)
         async for response in responses:
+            logging.debug("Sending TCP response: %s", response.hex())
             writer.write(response)
             await writer.drain()