From 84cac870d5b34fefa9520ddc4dfd013075c50f1e Mon Sep 17 00:00:00 2001 From: gorkem-bwl Date: Tue, 10 Mar 2026 19:04:04 -0400 Subject: [PATCH] fix: set DNS cache TTL to prevent stale lookups CacheableLookup defaults to maxTtl=Infinity, meaning successful DNS lookups are cached forever until process restart. This causes monitors to fail permanently if DNS changes or if a resolver outage causes ENOTFOUND errors to persist after recovery. Set maxTtl=300s (5 min) for successful lookups and errorTtl=30s for failed lookups so the cache recovers automatically. --- server/src/service/infrastructure/network/HttpProvider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/service/infrastructure/network/HttpProvider.ts b/server/src/service/infrastructure/network/HttpProvider.ts index 42fa39a40..a947727fd 100644 --- a/server/src/service/infrastructure/network/HttpProvider.ts +++ b/server/src/service/infrastructure/network/HttpProvider.ts @@ -15,7 +15,7 @@ export class HttpProvider implements IStatusProvider { private got: Got, private advancedMatcher: AdvancedMatcher ) { - const cacheable = new CacheableLookup(); + const cacheable = new CacheableLookup({ maxTtl: 300, errorTtl: 30 }); this.got = got.extend({ dnsCache: cacheable, timeout: {