<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap:break-word"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">Hi,</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">I have a problem with packet cache when trying to use it in case of all servers are down. Namely, I’ve tried setting it up to cache entries for up to a day in case of a problem but it always expires after 2 minutes.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">I’m using following config:</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><div id="bloop_customfont" style="margin:0px">newServer({address="<a href="http://127.0.0.1:54">127.0.0.1:54</a>", name="local", qps=1000})</div><div id="bloop_customfont" style="margin:0px">setServerPolicy(firstAvailable) -- first server within its QPS limit</div><div id="bloop_customfont" style="margin:0px">controlSocket('<a href="http://127.0.0.1:5199">127.0.0.1:5199</a>')</div><div id="bloop_customfont" style="margin:0px">addLocal('<a href="http://0.0.0.0:53">0.0.0.0:53</a>', { doTCP=true, reusePort=true })</div><div id="bloop_customfont" style="margin:0px">setKey(“xyz")</div><div id="bloop_customfont" style="margin:0px">webserver(“xyz")</div><div id="bloop_customfont" style="margin:0px">pc = newPacketCache(100000, 86400, 1, 86400, 86400, true)</div><div id="bloop_customfont" style="margin:0px">getPool(""):setCache(pc)</div><div id="bloop_customfont" style="margin:0px">setStaleCacheEntriesTTL(3600)</div><div id="bloop_customfont" style="margin:0px">addACL("<a href="http://0.0.0.0/0">0.0.0.0/0</a>”)</div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">start up dnsdist, run a query, getServer(0):setDown() and keep doing dig and it starts failing after two minutes with:</div><div id="bloop_customfont" style="margin:0px"><div id="bloop_customfont" style="margin:0px">; <<>> DiG 9.10.3-P4-Ubuntu <<>> <a href="http://example.com">example.com</a> @<a href="http://127.0.0.1">127.0.0.1</a> -p 53</div><div id="bloop_customfont" style="margin:0px">;; global options: +cmd</div><div id="bloop_customfont" style="margin:0px">;; connection timed out; no servers could be reached</div></div></div><div class="bloop_sign" id="bloop_sign_1520529052665893120"></div><div class="bloop_sign" id="bloop_sign_1520529052665893120"><br></div><div class="bloop_sign" id="bloop_sign_1520529052665893120">In my understanding of the packet cache, it would cache for up to 86400 if the cache is expired, but it looks like cache gets expunged since doing stats on the cache:</div><div class="bloop_sign" id="bloop_sign_1520529052665893120">Running:</div><div class="bloop_sign" id="bloop_sign_1520529052665893120"><div class="bloop_sign" id="bloop_sign_1520529052665893120">dnsdist 1.2.1 (Lua 5.1.4)</div><div class="bloop_sign" id="bloop_sign_1520529052665893120">Enabled features: dnscrypt libsodium protobuf re2 systemd</div><div class="bloop_sign" id="bloop_sign_1520529052665893120"><br></div><div class="bloop_sign" id="bloop_sign_1520529052665893120">on Ubuntu 16.04.</div></div></body></html>