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

Nicholas Mu nhmu at alumni.cmu.edu
Wed May 5 23:14:59 UTC 2021


Hi bumping this thread, still wondering if this is something that could be
supported or I should look for some alternative solution.

Thanks,
Nick

On Fri, Nov 6, 2020 at 3:35 PM Nicholas Mu <nhmu at alumni.cmu.edu> wrote:

> Hi,
>
> Attached a patch for the described issue.
>
> Thanks,
> Nick
>
>
>
> On Mon, Sep 28, 2020 at 1:25 PM Nicholas Mu <nhmu at alumni.cmu.edu> wrote:
>
>> 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/20210505/761c951f/attachment.htm>


More information about the Dnsmasq-discuss mailing list