From 09244cbd98d119fdc9b8ead9dfe66b7f1b833ba4 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 1 Jun 2020 01:12:43 +0200 Subject: [PATCH] nixos/nscd: set positive hosts caching ttl to 0 This effectively disables nscd's built-in hosts cache, which turns out to be erratic in some cases. We only use nscd these days as a more ABI-neutral NSS dispatcher mechanism. Local caching should still be possible with local resolvers in /etc/resolv.conf (via the `dns` NSS module), or without local resolvers via systemd-networkd (via the `resolve` nss module) We don't set enable-cache to no due to https://github.com/NixOS/nixpkgs/pull/50316#discussion_r241035226. --- nixos/modules/services/system/nscd.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/system/nscd.conf b/nixos/modules/services/system/nscd.conf index 2b7523a7346dd..722b883ba420b 100644 --- a/nixos/modules/services/system/nscd.conf +++ b/nixos/modules/services/system/nscd.conf @@ -24,7 +24,7 @@ negative-time-to-live netgroup 0 shared netgroup yes enable-cache hosts yes -positive-time-to-live hosts 600 +positive-time-to-live hosts 0 negative-time-to-live hosts 0 shared hosts yes