Received: from mx.ams1.isc.org (mx.ams1.isc.org [199.6.1.65]) by bugs.isc.org (Postfix) with ESMTP id EE0642D20571 for ; Wed, 23 Jul 2014 15:36:26 +0000 (UTC) Received: from ppsw-50.csi.cam.ac.uk (ppsw-50-v6.csi.cam.ac.uk [IPv6:2001:630:212:8::e:f50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx.ams1.isc.org (Postfix) with ESMTPS id 089971FCB01 for ; Wed, 23 Jul 2014 15:36:25 +0000 (UTC) Received: from hermes-1.csi.cam.ac.uk ([131.111.8.51]:54512) by ppsw-50.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.158]:25) with esmtpa (EXTERNAL:fanf2) id 1X9yae-0004bR-rj (Exim 4.82_3-c0e5623) (return-path ); Wed, 23 Jul 2014 16:36:24 +0100 Received: from fanf2 by hermes-1.csi.cam.ac.uk (hermes.cam.ac.uk) with local id 1X9yae-0000th-Hd (Exim 4.72) (return-path ); Wed, 23 Jul 2014 16:36:24 +0100 CC: dot@dotat.at Delivered-To: bind9-bugs@bugs.isc.org Subject: [PATCH] Log outgoing query packets X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.0 Return-Path: X-Original-To: bind9-bugs@bugs.isc.org Sender: Tony Finch Date: Wed, 23 Jul 2014 16:14:42 +0100 X-Cam-Antivirus: no malware found X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mx.ams1.isc.org Message-ID: To: bind9-bugs@isc.org X-Cam-Scannerinfo: http://www.cam.ac.uk/cs/email/scanner/ From: Tony Finch X-RT-Original-Encoding: ascii content-type: text/plain; charset="utf-8" Content-Length: 925 This is handy for debugging interop problems, so we can see exactly what named is sending without fiddling with tcpdump. I have set the message's debug level to 11 so a debug level of 10 continues to produce only incoming packets in the log. Nothing else is at level 11. --- lib/dns/resolver.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 96cd534..8ef2c5b 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -2228,6 +2228,16 @@ resquery_send(resquery_t *query) { } /* + * Log the outgoing packet. + */ + dns_message_logfmtpacket(fctx->qmessage, "sending packet:\n", + DNS_LOGCATEGORY_RESOLVER, + DNS_LOGMODULE_PACKETS, + &dns_master_style_comment, + ISC_LOG_DEBUG(11), + fctx->res->mctx); + + /* * We're now done with the query message. */ dns_message_reset(fctx->qmessage, DNS_MESSAGE_INTENTRENDER); -- 2.0.1