Loading
The Trailblazer Community is now read-only Read More

CloudHub 2.0 Private Space: DNS Caching Behavior

Publish Date: Nov 3, 2026
Description

How long does a CloudHub 2.0 private space cache DNS answers for the internal domains configured in its DNS settings? Are expired answers reused if my DNS servers are unreachable? What should I expect during and after a VPN or Transit Gateway maintenance window?

Resolution

** At a glance **

If your private space resolves internal domains through your own DNS servers, here's the short version:

Answers are cached for up to 150 seconds. If your DNS record has a shorter TTL, the shorter TTL is used, down to a minimum of 5 seconds. "Domain not found" answers are also cached for up to 150 seconds, based on your zone's SOA record.

Expired answers aren't reused. Once a cached answer expires, your DNS servers have to be asked again.

If none of your DNS servers can be reached, each lookup takes about 5 seconds to fail. These failures aren't cached, so every new lookup waits the full 5 seconds again.

When your DNS servers are reachable again, resolution recovers by itself within a couple of seconds. You don't need to restart anything on the private space.

The rest of this article explains each of these points.

 

** How it works **

Each worker node in your private space runs its own DNS cache. It's managed by the platform and based on CoreDNS, an open-source DNS server. When one of your applications looks up a hostname, the request always goes to the cache on the node where that application replica is running.

Where the request goes next depends on the hostname:

Internal domains: the domains you added to the private space's DNS settings. The cache sends these lookups straight to the internal DNS servers you configured, over your VPN or Transit Gateway.

Everything else: public names such as google.com. These are resolved by the platform through AWS.

If a lookup is already in the cache, the answer is returned right away and your DNS servers aren't contacted.

Because each node keeps its own cache, replicas of the same application that run on different nodes may cache the same name at different times. Their cached answers then expire at different times.

 

** How long answers are cached **

A successful answer (the hostname exists) | Your record's TTL, between 5 and 150 seconds

A "domain not found" answer (NXDOMAIN or NODATA) | The negative-caching TTL from your zone's SOA record, between 5 and 150 seconds. If the reply doesn't include an SOA record, it's cached for 5 seconds.

Example: if your DNS record has a TTL of 30 seconds, it's cached for 30 seconds. If it has a TTL of 1 hour, it's cached for 150 seconds.

 

** Other behavior (standard CoreDNS defaults) **

The platform doesn't change the settings below, so they follow the standard behavior of the CoreDNS cache and forward plugins.

Reusing expired answers (serve_stale) | Turned off. An expired answer is never handed out, even if your DNS servers can't be reached.

Refreshing answers early (prefetch) | Turned off. An answer is only refreshed after it expires and someone looks it up again.

Shortest cache time | 5 seconds, even if your record's TTL is lower.

SERVFAIL replies from your DNS servers | If one of your DNS servers replies with SERVFAIL (for example, because it can't reach its own upstream), that reply is cached for up to 5 seconds. If no server replies at all, nothing is cached.

Choosing a DNS server | Each lookup goes to one of your configured DNS servers, picked at random.

When a DNS server doesn't reply | The lookup moves on to another one of your servers. Each try waits up to 2 seconds, and the lookup gives up after about 5 seconds in total.

When a DNS server replies with an error | If a server answers "domain not found" (NXDOMAIN) or another error such as SERVFAIL or REFUSED, that answer is final. Your other servers aren't asked.

Detecting a server that's down | When a server stops replying, health checks start. Each check waits up to 1 second for a reply, with half a second between checks. After 3 failed checks in a row (about 4 seconds), the server is skipped. It's used again as soon as it answers a check.

When all your DNS servers are down | Lookups are still sent to one of them at random, in case it has come back.

 

** What happens if your DNS servers can't be reached **

This applies to planned maintenance or an unexpected outage on the VPN or Transit Gateway that connects the private space to your DNS servers.

If at least one of your DNS servers is still reachable:

DNS keeps working. For the first few seconds, a lookup that happens to go to an unreachable server waits about 2 seconds and then moves on to a working one. After about 4 seconds, the unreachable servers are skipped and lookups are fast again.

If none of your DNS servers can be reached:

Answers already in the cache keep working until they expire, after at most 150 seconds. Each node's cache expires on its own schedule.

After that, lookups for those hostnames fail. Expired answers aren't reused.

Every lookup that can't be answered from the cache waits about 5 seconds and then fails. Your applications see this as a DNS error, such as "unknown host" or "couldn't resolve address".

These failures aren't cached, so each new lookup waits the full 5 seconds again. Expect slower responses as well as errors while the outage lasts.

A DNS server that can't be reached doesn't reply at all, so it can't send a "domain not found" or SERVFAIL answer. That means an outage doesn't leave failed answers sitting in the cache afterwards.

When the connection comes back:

Health checks keep running while your DNS servers are down, so the servers are used again within a second or two of becoming reachable.

No failures from the outage are cached, so names resolve as soon as your servers answer.

DNS resolution works again on its own. You don't need to restart anything on the private space.

 

** Tips **

Keep your DNS servers in sync. Every DNS server you configure should return the same records for every internal domain. If one server says a name doesn't exist, that answer is used, even if your other servers know the name. See CloudHub 2.0 Private Space: Intermittent UnknownHostException Caused by a DNS Race Condition Across Multiple Internal DNS Servers.

For planned maintenance, expect internal hostnames to stop resolving only while all your DNS servers are unreachable. Answers that are still cached when the connection drops keep working for up to 150 seconds. After that, each lookup takes about 5 seconds to fail until the connection is back. Everything recovers within a couple of seconds of the connection coming back.

 

Note
CoreDNS is an open-source project maintained by the CoreDNS community. It isn't a MuleSoft product. The CoreDNS default behaviors described in this article are based on the CoreDNS documentation and may differ between CoreDNS versions or change in future releases. For the authoritative and most up-to-date behavior, refer to the official CoreDNS documentation:

CoreDNS cache plugin: https://coredns.io/plugins/cache/
CoreDNS forward plugin: https://coredns.io/plugins/forward/


Related documentation
- [Gathering Required Setup Information (Internal DNS)](https://docs.mulesoft.com/cloudhub-2/ps-gather-setup-info)
- [CloudHub 2.0 Networking Architecture](https://docs.mulesoft.com/cloudhub-2/ch2-networking-guide)
- [CoreDNS cache plugin](https://coredns.io/plugins/cache/)
- [CoreDNS forward plugin](https://coredns.io/plugins/forward/)

Knowledge Article Number

005465989

 
Loading
Salesforce Help | Article