DNS cache and TTL: why a new address is not immediate
DNS is intentionally cached to reduce latency and name-server load. A record change therefore does not appear in every application at once. Caches may exist in the application, operating system, local resolver, and upstream recursive service. Troubleshooting should identify each layer instead of treating DNS as one global value.
Key points in one minute
- TTL limits how long a DNS record may remain cached.
- Different environments can temporarily return old and new addresses.
- Clearing one cache does not clear every other cache.
- A forced mapping is useful for testing but does not prove public propagation.
What TTL means
The zone owner sets a record's TTL as the maximum cache lifetime. A zero TTL prevents ordinary caching, but permanently low values increase query volume. For planned changes, operators commonly lower TTL in advance and restore a normal value after stabilization.
Where an old answer can remain
Results can be held by the application, system resolver, home or corporate DNS, and recursive service. An already-open connection can also continue using the old address after a fresh lookup changes. DNS cache and connection reuse must be checked separately.
Testing a specific address
curl can temporarily map a host and port to an address with CURLOPT_RESOLVE or the resolve command option. This tests a future endpoint while preserving the correct URL hostname and TLS identity. It does not show that public DNS has already propagated.
A diagnostic sequence
Record the authoritative value and TTL, then compare the resolvers relevant to the workflow. After TTL expiry, open a new connection and repeat the application request. Avoid restarting unrelated infrastructure before locating the exact cache or transport layer.
Practical checklist
- 1Record the previous and new DNS values.
- 2Verify TTL at the authoritative source.
- 3Compare local and server-side resolver answers.
- 4Create a fresh connection after TTL expiry.
- 5Remove temporary resolve rules after testing.
Sources and documentation
This material is based on primary, official, and technical sources. The article is an original summary written for this knowledge base.