<div dir="ltr"><div dir="ltr"><div>Hi,</div><div><br></div><div>Attached a patch for the described issue. </div><div><br></div><div>Thanks,</div><div>Nick</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 28, 2020 at 1:25 PM Nicholas Mu <<a href="mailto:nhmu@alumni.cmu.edu">nhmu@alumni.cmu.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi, <div><br></div><div>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? </div><div></div><div><br></div><div>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.</div><div><br></div><div>Without --no-negcache:</div><div>Sep 28 13:09:36 dnsmasq[73688]: query[A] doesnotexist54321 from 127.0.0.1<br>Sep 28 13:09:36 dnsmasq[73688]: forwarded doesnotexist54321 to 172.16.153.81<br>Sep 28 13:09:36 dnsmasq[73688]: reply doesnotexist54321 is NXDOMAIN<br></div><div><br></div><div>With --no-negcache:</div><div>Sep 28 13:10:24 dnsmasq[74398]: query[A] doesnotexist54321 from 127.0.0.1<br>Sep 28 13:10:24 dnsmasq[74398]: forwarded doesnotexist54321 to 172.16.153.81<br><br></div><div>Thanks,</div><div>Nick</div><div><br></div></div>
</blockquote></div></div>