nscd (8) daemon caches negative responses for infinite time. Parameter 'negative-time-to-live' in /etc/nscd.conf doesn't correct this behavior. Fix: Supplied below corrects nscd behaviour on 9.1-RELEASE-p4 and HEAD: if (read_response->error_code == -2) { - read_response->error_code = 0; - read_response->data = NULL; - read_response->data_size = 0; + read_response->data = malloc( + read_response->data_size); + assert(read_response != NULL); + read_response->error_code = cache_read(neg_c_entry, + read_request->cache_key, + read_request->cache_key_size, + read_response->data, + &read_response->data_size); } } configuration_unlock_entry(qstate->config_entry, CELT_NEGATIVE);--gWC5PrrXOzg1QvWcCoB7krostOmUDgByPCTXeREr3OSdbDs2 Content-Type: text/plain; name="file.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="file.diff" --- usr.sbin/nscd/query.c.orig 2013-08-22 11:59:03.921956888 +0400 +++ usr.sbin/nscd/query.c 2013-08-22 12:00:01.515957178 +0400 @@ -743,9 +743,14 @@ &read_response->data_size); How-To-Repeat: Try set 'negative-time-to-live hosts 1' in /etc/nscd.conf and 'hosts: files cache dns' in /etc/nsswitch.conf. Restart nscd: '/etc/rc.d/nscd onerestart'. Now we can see output of 'tcpdump udp and port 53' and repeat many times: 'ping -c1 some.nonexistent'. Only first time there will be actual dns search (with expected negative response).
Allan may also be interested in this
In 2016, still interesting in this
Allan, if you're wrapped up in other work and don't think this will be feasible could you document what you know about it on the Junior Jobs page? Maybe a community member can pick it up. Thanks!
I am happy to give this bug up if someone is interested
batch change: For bugs that match the following - Status Is In progress AND - Untouched since 2018-01-01. AND - Affects Base System OR Documentation DO: Reset to open status. Note: I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.
last I knew this was still a valid issue.
This was fixed in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207804 The fix was committed in as r318578 in May 2017. *** This bug has been marked as a duplicate of bug 207804 ***