DNS cache is a temporary storage of recent DNS lookups that helps your device or network resolve domain names (like example.com) to IP addresses faster by reusing previously found results instead of asking DNS servers every time. It reduces latency, cuts down on DNS traffic, and exists at several layers such as your browser, operating system, router, and your ISP’s or public DNS resolver.

What DNS cache actually is

DNS cache holds small records that map domain names to IP addresses (A/AAAA records and others) for a limited time called TTL (Time To Live). Once the TTL expires, the entry is discarded and a fresh DNS query is made so that the information does not go stale.

Key ideas:

  • Temporary : Stored only for a configurable duration (TTL).
  • Local or network-based: Exists on your device, router, and DNS resolvers.
  • Performance-focused: Designed to avoid repeated full DNS lookups.

How DNS caching works (step by step)

  1. You type a domain like example.com into your browser.
  2. The browser first checks its own DNS cache for a recent record.
  1. If missing, the operating system DNS cache is consulted.
  1. If still missing, the query is sent to a DNS resolver (often your ISP or a public DNS like 1.1.1.1 or 8.8.8.8), which has its own cache.
  1. If the resolver also has no cached record, it queries the authoritative DNS servers for the domain and returns the response, which is then cached at each level for its TTL.

This multi-layer caching is why revisiting a site usually feels faster than the first time.

Why DNS cache matters

From a practical, user-facing angle, DNS caching does three major things:

  • Speeds up browsing : Returning an IP from cache is much quicker than a full recursive DNS lookup across the internet.
  • Reduces network and server load: Fewer queries hit upstream and authoritative DNS servers, which is critical at internet scale.
  • Improves resilience: If an upstream DNS server is slow or briefly unreachable, local caches can still answer many queries during the TTL window.

On the admin / infrastructure side:

  • TTL tuning lets admins balance fast changes vs performance; static content often gets long TTLs, while dynamic or migrating services use shorter TTLs.
  • ISPs and large resolvers maintain very large caches to handle traffic efficiently for millions of users.

Where DNS cache lives (layers)

You can think of DNS cache as stacked layers, each trying to answer before escalating to the next:

  • Browser cache – The browser saves DNS results for recently visited domains to speed up tab loads and repeat visits.
  • OS cache – The operating system keeps a shared DNS cache for all apps, so they do not each query the network separately.
  • Router / local resolver – Home or office routers sometimes cache DNS for devices on the network.
  • ISP / public DNS resolver cache – Big resolvers (like those at ISPs or public DNS providers) hold extensive caches that serve many users.

Some setups also involve CDN-aware DNS and internal resolvers that cache and route users to optimal servers, further improving latency.

When and why to flush DNS cache

Flushing (clearing) DNS cache removes stored records so the next lookup is forced to fetch fresh data. This is commonly used when:

  • A site has moved or updated DNS but your system still has the old IP, causing errors or sending you to the wrong server.
  • You are troubleshooting connectivity or intermittent name resolution issues and want to rule out corrupted or stale cache entries.
  • You suspect DNS cache poisoning or security issues and want to reset local DNS data.

Most operating systems provide a flushdns-style command or system action to clear the cache, after which DNS entries are gradually repopulated as you browse.

TL;DR: DNS cache is the temporary memory of recent DNS lookups that helps the internet feel fast by avoiding repeated full lookups, while still expiring regularly via TTL so domain changes eventually take effect.

Information gathered from public forums or data available on the internet and portrayed here.