A DNS cache retains the answers to earlier domain queries so the next request may be answered without starting resolution again. That saves time and authoritative-server capacity. It also explains a common operations puzzle: one computer reaches a new service endpoint while another still uses the former address. The practical skill is locating which cache has which answer and why, not assuming that every cache instantly follows a DNS change.
The caching layers are independent
A browser or application may hold an address in its own connection pool or lookup cache. An operating system may maintain a DNS cache. A recursive resolver shared by an office or ISP may keep records for many clients. The authoritative DNS server holds the zone’s configured data; it does not push every address change directly into those independent caches.
If two clients disagree, start by querying the authoritative record and then their actual recursive resolvers. One may have a different cached answer or may be using split-horizon internal DNS. Simply clearing a browser’s generic history does not necessarily flush the operating system resolver, a JVM’s DNS cache or the enterprise recursive resolver.
TTL controls cache freshness, with documented exceptions
Most positive DNS record responses include a Time to Live (TTL) measured in seconds. A cache generally decrements the remaining TTL and refreshes a record after it expires on a later lookup. A lower TTL may increase authoritative query volume but allow a new result to be seen sooner by caches that honor it. Reducing a TTL just before cutover does not shorten old cached responses that were learned earlier at a higher value.
TTL is not a global timer that commands every DNS server to update simultaneously. Some resolvers impose local limits, clients may retain connections to an old IP, and RFC 8767 permits recursive resolvers to serve otherwise expired answers under defined authoritative-failure conditions. This serve-stale behavior improves resilience but must not be confused with a guarantee of fresh data.
Not-found answers also have a cache lifetime
A recursive resolver can cache that a name does not exist (NXDOMAIN) or that a requested type has no data (NODATA). This negative caching prevents repeated unnecessary lookups. RFC 2308 describes a negative cache lifetime derived from the relevant SOA record information, not from an imaginary positive A record for the missing hostname.
Suppose a team queries new-app.example.net before the record is created. After they add it to the authoritative zone, some clients may still receive a cached negative answer until its remaining negative TTL expires. Sending more queries to the same cache will not force it to forget the prior result. Inspecting the response authority section and SOA timing can help explain the delay.
Use answer differences to locate the failing layer
Compare a lookup through the client’s normal resolver with a query to the authoritative nameserver. With a suitable tool, a resolver-specific query might be written as dig @resolver.example.net app.example.net A; this is an illustrative placeholder and has not been run against live infrastructure. Record the answer, response code, TTL and resolver identity. Repeat the comparison from another network if the client is using a VPN or enterprise DNS.
If the authoritative answer is correct but one resolver returns an old address, investigate TTL and cache policy. If authoritative zones disagree, fix the publishing/delegation or zone-replication problem rather than blaming client caching. If all DNS queries are correct but the app connects to the wrong place, inspect browser/application connection reuse, proxy configuration, NAT, load balancing and stored endpoints.
DNSSEC is not the same as encrypted DNS transport
DNSSEC uses signatures and validation to help a validating resolver detect unauthentic or altered signed DNS data. It depends on an appropriate trust chain and correctly configured signing and validation. It does not encrypt domain-name queries.
DNS over TLS (DoT) and DNS over HTTPS (DoH) protect DNS transport to a resolver when appropriately configured; they do not by themselves prove that a DNS answer reflects a correctly signed authoritative zone. A secure transport connection can faithfully deliver an incorrect record if the data source or resolver is wrong. These technologies address complementary threats.
Do not rely on cache flushing as your only recovery plan
A targeted cache flush may help one client after a known bad cached answer, but it cannot refresh remote clients’ caches, repair the authoritative zone or reconnect an already failed application session. Full-fleet cache flushing also discards useful data and increases query load. Diagnose the layer first and document exactly why a flush is appropriate.
For a DNS-based service migration, reduce TTL sufficiently in advance, maintain both old and new endpoints during the expected overlap, monitor answers from relevant resolvers and retain a tested rollback route. The goal is to keep users connected despite different cache states, not to claim that DNS itself guarantees zero downtime.
Monitor DNS behavior with meaningful evidence
Resolver cache-hit ratio, query latency, response codes, negative-answer volume, upstream timeouts and validation failures tell different stories. An unusually high hit ratio is not automatically good if the cache is serving incorrect or undesired answers. A spike in SERVFAIL may indicate problems upstream or, where DNSSEC is used, a validation issue that requires separate investigation.
Keep DNS query logs within the organization’s privacy and retention rules: domain queries can reveal sensitive behavioral information. Consider application-side caches and Java runtime TTL policies in architecture documentation where applicable. The best incident runbook links each observed symptom to a queryable layer, a responsible owner and a safe validation step.
A worked cutover with two DNS views
Suppose api.example.net previously resolves to 192.0.2.20 with a one-hour TTL, and the new endpoint will be 192.0.2.30. Lowering the TTL to 60 seconds at 09:59 does not force a resolver that cached the old address at 09:55 to refresh immediately at 10:00. It can legitimately retain its old answer until approximately 10:55. A safe deployment lowers the TTL far enough ahead of the migration for old cache entries to expire, while retaining the old endpoint during the overlap.
A second complication occurs when office clients query an internal resolver and mobile users query a public one. They might intentionally receive different addresses, even without stale caches. Test both resolution views before assuming a global DNS update failed. A public authoritative query that looks correct does not validate an internal split-horizon record.
When a client has cached NXDOMAIN for a name not yet created, shortening that new A record’s TTL does nothing about its earlier negative answer. The resolver’s negative caching policy and the zone SOA information determine its expiration. This is why preflight DNS checks should include missing names as well as existing ones.
DNS caching is essential to the internet’s scale because it saves repeated work. Reliability comes from understanding the time boundaries and exceptions, differentiating authoritative from cached answers, and verifying the actual client experience after changes.