]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r318578:
authorcy <cy@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 30 May 2017 03:27:59 +0000 (03:27 +0000)
committercy <cy@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 30 May 2017 03:27:59 +0000 (03:27 +0000)
commit3985e59019700bfa215a9de026b3cb6bd544bda3
treef3cb78740efbbf951cf673640201f870d0b94564
parent67056825cbe3bd639314f311fdd39937554fa893
MFC r318578:

Fix non-recoverable name resolution failures due to negative cache
entries never expiring. This patch honours the negative cache timeout.

To test/experience the failure do the following:

1. Edit /etc/ncd.conf to adjust the cache timeouts as follows:

positive-time-to-live hosts 30
negative-time-to-live hosts 1

2. Ensure that nsswitch.conf hosts line contains something like:

hosts: files cache dns

Note that cache must be specified before dns.

3. Start nscd.

4. Run the following command:

while true; do nc -z -w 3 www.google.com 80; sleep 5; done

5. While running the command, remove or comment out all nameserver
   statements in /etc/resolv.conf. After a short while you will notice
   non-recoverable name rsolution failures.

6. Uncomment or replace all nameserver statements back into
   /etc/resolv.conf. Take note that name resolution never recovers.
   To recover nscd must be restarted. This patch fixes this.

PR: 207804
Submitted by: Jov <amutu@amutu.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@319177 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
usr.sbin/nscd/query.c