[Dnsmasq-discuss] Logging NXDOMAIN responses when --no-negcache is enabled

Nicholas Mu nhmu at alumni.cmu.edu
Mon Sep 28 21:25:26 BST 2020


Hi,

I have a use case where I'd like to log queries (--log-queries) and disable
negative caching (--no-negcache). One issue I found is that when using
--no-negcache, dnsmasq no longer logs NXDomain responses. Digging through
the code, it looks like as part of the dns cache insertion we will log the
response of a query. As such if the cache insertion is never executed for
negative responses (i.e --no-negcache), then the response is not logged. Is
this the intended behavior/Can this functionality be added?

I would like to have the NXDOMAIN in the logs as I would like to
differentiate between NXDOMAIN responses and failing to receive a response.

Without --no-negcache:
Sep 28 13:09:36 dnsmasq[73688]: query[A] doesnotexist54321 from 127.0.0.1
Sep 28 13:09:36 dnsmasq[73688]: forwarded doesnotexist54321 to 172.16.153.81
Sep 28 13:09:36 dnsmasq[73688]: reply doesnotexist54321 is NXDOMAIN

With --no-negcache:
Sep 28 13:10:24 dnsmasq[74398]: query[A] doesnotexist54321 from 127.0.0.1
Sep 28 13:10:24 dnsmasq[74398]: forwarded doesnotexist54321 to 172.16.153.81

Thanks,
Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20200928/e7a87e29/attachment.html>


More information about the Dnsmasq-discuss mailing list