TTL is an expiring note
A DNS response's TTL says how long a record may be cached. A repeat query can be answered from valid cache, with the returned TTL decreasing over time.
Not every response is cacheable. For example, TTL-zero responses are not stored, and negative answers need an eligible SOA.
Prefetch is not serving stale answers
updns can proactively refresh entries after at least 80% of their original TTL has elapsed. It first tries the entry's original winning upstream, then falls back according to the selected strategy if that fails.
If an entry has expired and is being prefetched, a foreground query waits for that task. A failed refresh returns failure, not stale data.
Observe the cache with an audit
With the service running, audit the same domain repeatedly to inspect its path. The first query is not necessarily an upstream query: another client may already have populated the cache, and TTL and prefetch also affect the result.
Command
updns google.comExample output
From the project guide; actual output depends on configuration, cache, and network conditions.
Domain : google.com.
Query Type : A / AAAA
Query Path : Cache Hit
Matched Rule : US Access
Upstream : A=Google-DoH / AAAA=Google-DoH
Action : IPv4 + IPv6
Response : NOERRORHow to read it
Cache Hit means a valid cache entry answered this query. Upstream is the entry's original source, not a server contacted this time; NOERROR indicates a successful DNS response.
What operators should remember
Cache lives in process memory and does not persist across restarts. A restart or service reload starts with an empty cache; the displayed entry count may include expired entries.
Run updns status to see the listening port, cache configuration, and entries ranked by hits; press q to leave the interactive view. An unavailable status does not necessarily mean the service has stopped: also check service status and logs.
updns status