+8618758069661 [email protected]
Product Search Guide: space = AND, | = OR, ! = NOT

Server Address Changed, Gateway Still Connecting to the Old One? DNS Cache and TTL

Got any Questions? Call us Today!

+8618758069661

Or leave us a message

Online Message

Server Address Changed, Gateway Still Connecting to the Old One? DNS Cache and TTL

Views: 25 +25Original by FCTELEAuthor: FCTELE Technical Team

DNS / CACHE LIFETIME

Why can a gateway still use the old server address?

A resolver may reuse a cached DNS answer while its lifetime remains. Changing the authoritative record does not rewrite every existing cache, and an established application connection does not move automatically. Correlate the resolver answer, its remaining TTL and the actual destination of a new connection. The 300-second example excludes prefetch and stale-answer policies; verify actual firmware behavior.

01 · Cache hit

Cache hitConnectNo new DNS query needed

A usable cached answer can supply the address without another query. Check which resolver and cache the application actually uses.

02 · Count down, do not restart

0 s120 s300 sTTL 300 → TTL 180 → expires

In this teaching example, a cache hit after 120 seconds leaves 180 seconds. Expiry does not close an existing TCP session.

03 · Compare answer and destination

DNS answerActual connection

Observe both independently. A laptop answer alone does not prove that the field gateway has re-resolved or reconnected.

Identify the resolver

Record actual DNS server, name and record type.

Preserve timing

Save answer TTL and observation time before changing state.

Verify the connection

Match a new answer to the actual new destination.

Selection and verification checklist — expand
Check Confirm Verify
Cache Which layer holds it Device settings and observed queries
Timing Original and remaining TTL Time-stamped answers
Recovery New connection destination Authorized capture and sustained serial data

The platform has moved to a new server, but a field serial gateway still connects to the old address. A service laptop already resolves the name to the new address. Different results do not automatically mean one device is misconfigured. The Domain Name System, DNS, maps names to records such as addresses, and those answers can be cached. Identify the cache layer, its remaining lifetime and when the application resolves the name again to explain the transition.

Gateway uses a software cache hit without another DNS query
Figure 1. Generic software cache-hit and connection path, not a specific product circuit. Blue paths represent logical connections. Original FCTELE illustration, AI-assisted.

Resolving a name and making a connection are separate steps

When a gateway initiates a connection to a named remote service, it normally obtains an address through a resolver, then passes that address and the service port to the connection process. DNS supplies records; it does not forward serial bytes to the platform or establish TCP. Ethernet LINK, a DNS answer and a working application session are three different observations.

FCTELE’s Chinese single-port RS 232/RS 485 serial server documentation lists DNS and TCP client networking capabilities. It provides a real product context for the path from serial reception through networking software to a remote service. This article explains generic resolver caching, rather than establishing the product’s cache location, query interval or firmware implementation. Check name support, DNS selection and reconnection behavior against the actual model documentation.

If the connection target is entered directly as an IP address, the device may not query DNS for that target at all. Conversely, a correctly configured name does not prove the returned address has an open service port or a ready application. Record the target format first. A DNS setting on a configuration page does not make DNS the cause of every communication fault.

Why can a cache hit produce no new DNS packet?

After receiving a cacheable answer, a resolver can retain the name, record type, record data and validity information. If the same answer is needed while usable, the resolver can return it without repeating the query. This reduces traffic and waiting. A cache is software-maintained data, rather than a separate chip beside the port or the switch’s MAC forwarding table.

Caching may exist in the application’s name-handling module, the device’s system resolver or an upstream recursive DNS server. A laptop and industrial gateway on the same switch need not use the same resolver or cache. Different query times, different configured DNS servers, or a static name mapping on one device can produce temporarily different addresses.

Not observing a new query outside the gateway therefore does not prove that it made no connection attempt. It may be using a cached address or an existing session. Observe the name query, the resulting address and the actual connection destination together. A single laptop lookup does not verify gateway behavior; some diagnostic tools also bypass the usual local resolver cache.

TTL 300 decreases to 180 then expires before a needed lookup
Figure 2. Teaching example: TTL 300 seconds, no prefetch or stale-answer policy. After 120 seconds, 180 remain. Expiry does not force TCP disconnection. Original FCTELE illustration, AI-assisted.

How does TTL limit the remaining life of an old answer?

TTL means Time To Live and is normally expressed in seconds in DNS records. It describes the cacheability of data, rather than how long a gateway stays online or when a TCP connection must close. Under normal caching behavior the remaining lifetime decreases with time. Expired data cannot simply be treated as an ordinary valid cache entry whose life restarts whenever it is used.

Consider a teaching example without prefetching, stale-answer retention or other special policies. An address record arrives at 12:00 with TTL 300 seconds. At 12:02, 120 seconds have passed, leaving approximately 180 seconds. A cache hit does not reset that to 300. At 12:05 this entry expires. If another resolution is needed afterward, usable answer data must be obtained again; TTL itself does not initiate an application connection.

If the authoritative record changes at 12:01, the previously cached old answer may still be used within its original validity period. That does not necessarily mean a new query returned the old record; there may have been no new query. When a recursive server supplies cached data downstream, remaining lifetime also matters. Forwarding an answer again must not indefinitely extend the old record’s life.

Why can an old address remain after TTL is reduced?

Changing TTL at the authoritative source does not normally rewrite caches already held by other resolvers. An earlier answer obtained with a longer lifetime does not automatically acquire the new shorter lifetime. Plan migrations around existing cache ages and application reconnection behavior, rather than changing one value at cutover and expecting every field device to switch simultaneously.

Cache expiry and application re-resolution are also different events. An established TCP session to the old server does not move to the new server because a DNS answer changes. An application may resolve again only on reconnection, or may maintain its own address and retry policy. Check separately whether DNS data updated, a new connection was attempted and its actual destination changed. These are not interchangeable meanings of DNS refreshed.

A name-not-found answer can also be cached, called negative caching. It differs from the positive address caching in the example. A timeout, a server failure and an explicit nonexistent-name answer have different meanings and should not all be described as waiting for TTL. Aliases, multiple address records and stale-answer policies require analysis of actual replies and resolver behavior; the example does not establish one universal waiting time for those cases.

DNS answer and actual connection destination are observed separately
Figure 3. Compare DNS answers with actual destinations. Old/new rows are alternative observations, not simultaneous measured logs. Verify capture-point capability. Original FCTELE illustration, AI-assisted.

Make the address change a verifiable timeline

Before maintenance, record the name, requested record type, DNS server actually used by the gateway, and intended old and new addresses. Where available, retain original replies with TTL, observation time and capture location, and align clocks. Obtain authorization for production maintenance. Do not indiscriminately clear a shared resolver’s cache or substitute large volumes of repeated queries for diagnosis.

Walk through the example: did the old answer at 12:00 really arrive with a 300-second lifetime? At 12:02 was the same cache used? After 12:05, when a new resolution was needed, where was the query sent and what answer returned? Then check whether the gateway’s new connection targeted the old or new address. If DNS updated but the application retained an old destination, investigate its address retention and reconnection rather than repeatedly editing DNS records.

For laptop comparisons, confirm the same DNS server, name suffix and record type are used. Otherwise two different paths are being treated as one experiment. On the server side distinguish new-address readiness from old-service shutdown. A refused connection can be a service or access-policy issue rather than resolution failure. Verify address reachability and application availability separately through controlled steps where needed.

After recovery, retain evidence of at least one new answer matching the actual destination of a new connection, then observe sustained serial data transfer. Recovery after restart only shows that several states were re-established. Recording queries, cache timing and application connections separately identifies the layer and supports the next platform migration.

Document exceptions as part of delivery. Static name files, application-specific address tables or explicit stale-answer policies should be listed separately rather than forced into the ordinary five-minute example. With configuration evidence preserved, another engineer can distinguish intended behavior from a missed update instead of repeatedly trying the same cache-clearing action.

Sources and scope

IETF RFC1034: DNS concepts · IETF RFC2308: negative caching · Microsoft: DNS queries and lookups · Microsoft: troubleshooting DNS clients · FCTELE serial server documentation (Chinese)

300 seconds is a teaching value, not a product setting. Verify cache layers, reconnect behavior, prefetch and stale-answer policies against actual implementations.

Translated from the Chinese technical article: Read the original Chinese article.

Common questions

Does TTL expiry close an existing TCP connection?

DNS cache expiry alone does not force a connection to close. Reconnection and re-resolution depend on the application; observe its actual destination.

Does reducing authoritative TTL immediately shorten every old cache?

Normally no. Existing answers at other resolvers retain their earlier validity information. Plan around the remaining lifetime.

Does a new answer on a laptop prove the gateway has updated?

No. Compare DNS server, record type, cache layer and query time, then observe the gateway connection destination.

Further reading

Serial server network settings (Chinese) · Dynamic name configuration (Chinese)

Share this article