2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

Add debug logs for outgoing DNS messages

Since AsyncDnsServer logs incoming DNS messages as seen on the wire, do
the same for the responses sent by the server.

(cherry picked from commit 2a9c74546d)
This commit is contained in:
Michał Kępień
2025-05-30 18:08:54 +02:00
parent 108adab25a
commit 717f334daf

View 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()