A DNS cache is a temporary store of recent domain name lookups on your device, router, or internet service provider's servers. Every time you visit a website, your device converts the human-readable address (like mediachannel.com.au) into a numeric IP address that computers can actually route to. Rather than repeating that lookup on every single visit, your system saves the result. That saved result is the DNS cache. It speeds up browsing, reduces load on the global DNS network, and mostly works without you ever noticing it. When it doesn't work, things get frustrating fast.
To understand why a DNS cache matters, it helps to understand what DNS does. DNS is the internet's address book, translating website names into the numeric addresses computers need. That translation involves querying a chain of servers, which takes time. Even 50 milliseconds adds up across dozens of requests per page load. Caching short-circuits most of those queries by storing the answer locally.
Where DNS caches live
Your DNS cache doesn't live in just one place. It sits in at least three locations simultaneously, and each one can cause its own brand of problem.
Your operating system maintains the first cache. Windows, macOS, and Linux all store DNS records locally. When you type an address into your browser, the OS checks its own cache before asking anyone else. If the record is there and hasn't expired, the lookup is instant.
Your router keeps a second cache. Home and office routers typically run a small DNS resolver that caches results for every device on the network. This means a single external lookup can serve multiple devices on the same Wi-Fi network without anyone going out to the internet again.
Your internet service provider runs a third cache, often the largest. ISPs operate DNS resolvers that handle millions of queries. Their caches are updated frequently but can still hold stale records if a website's configuration changes unexpectedly.
What is a TTL and why does it matter?
Every DNS record comes with a TTL (time to live), measured in seconds. The TTL tells every cache along the chain how long to keep that record before discarding it and fetching a fresh one. A TTL of 3600 means the record stays cached for one hour. A TTL of 86400 keeps it for a full day.
Website owners set their own TTL values. High TTLs reduce DNS query traffic and speed up browsing. Low TTLs give administrators faster control over where their site resolves, which matters when you're migrating servers or responding to an outage.
The practical tension: if a website moves to a new IP address, every cache holding the old record will keep serving the old address until its TTL expires. If the previous owner set a 24-hour TTL, some visitors might spend a full day unable to reach the updated site. This is called DNS propagation delay, and it's why experienced site administrators lower their TTL values a day or two before making a DNS change.
When DNS caching causes problems
The DNS cache usually helps. But there are specific situations where it actively gets in the way.
The most common problem is a stale record. You type a website address, your cache returns an IP address that no longer points to the right server, and the connection fails or lands on the wrong page. This happens most often after a site migration or a server change. The site is working perfectly for most users while cached records haven't yet expired for others.
A second problem is poisoning. DNS cache poisoning is an attack where malicious data is injected into a resolver's cache, redirecting users to fraudulent servers without them knowing. The user's browser shows the correct address in the URL bar, but the underlying IP has been swapped. This is precisely why technologies like DNSSEC exist: to digitally sign DNS records and prevent tampered responses from being accepted by resolvers. It sits in the same threat family as man-in-the-middle attacks, where an attacker intercepts and alters traffic between two parties.
A third problem is negative caching. If a lookup fails because a domain doesn't exist or a server is temporarily down, that failure can itself be cached. Your device remembers "this domain isn't reachable" and keeps returning that answer even after the server comes back online. The website recovers, but you can't see it until your negative cache entry expires.
How to flush your DNS cache
Flushing the DNS cache forces your system to discard everything it has stored and start fresh. The process varies by operating system.
- Windows: Open Command Prompt as administrator and run
ipconfig /flushdns. You'll see a confirmation message when it's done. - macOS (Ventura and later): Open Terminal and run
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder. The specific command varies slightly between macOS versions. - Linux: The command depends on your distribution and DNS service. On systems using systemd-resolved, run
sudo systemd-resolve --flush-caches.
Flushing your router's cache usually means restarting the router. Flushing your ISP's cache is not something you can do yourself, though some ISPs let you query an alternate resolver like Cloudflare's 1.1.1.1 or Google's 8.8.8.8 as a workaround, since those resolvers may hold fresher records.
Browser-level DNS caching
Chrome, Firefox, and Safari each maintain their own DNS cache on top of the operating system's. This is a fourth cache layer that most people don't know about. Chrome, for instance, caches DNS lookups independently for performance, and flushing the OS cache doesn't touch Chrome's internal store.
In Chrome, you can inspect and clear the browser's DNS cache by visiting chrome://net-internals/#dns and clicking "Clear host cache". This isn't a setting buried in preferences. It's a diagnostic tool built into the browser itself, which tells you something about how common these issues are in practice.
DNS caching and privacy
Your DNS cache is also a record of every website your device has resolved recently. Anyone with access to your device can read it. On shared computers, this is a minor but real privacy consideration. Flushing the DNS cache as part of a broader privacy cleanup removes that record.
At the network level, DNS queries sent to your ISP's resolver are visible to your ISP by default, since standard DNS traffic is unencrypted. Protocols like DNS over HTTPS (DoH) and DNS over TLS (DoT) encrypt the query so that only the resolver you've chosen can read it. Cloudflare's 1.1.1.1 resolver supports both protocols and doesn't log queries beyond 24 hours. Using an encrypted resolver doesn't change how caching works, but it does change who can see your lookup history.
Keeping DNS caching working in your favour
For everyday users, knowing how to flush the cache is enough. If a site suddenly stops working, clearing your DNS cache is a fast, free, and reversible first step before anything more involved.
For anyone running a website or network, TTL values deserve more attention than they usually get. Setting a TTL of 86400 is fine during stable periods, but dropping it to 300 before a planned migration gives you real-time control over where your domain resolves. After the change is confirmed and stable, you can raise the TTL again. That 10-minute window can save hours of debugging when something goes wrong mid-migration.
DNS caching is one of those infrastructure details that works silently until it doesn't. At that point, knowing what it is and where it lives saves real time.

