
What Is DNS Cache? Definition, Safety, and How to Flush It
Anyone who has typed a web address and waited for a page to load has encountered the DNS cache—a behind-the-scenes shortcut that saves time by remembering where websites live. This temporary storage system, which maps domain names to IP addresses, makes repeated visits faster but also raises questions about privacy and security. Understanding how to check and clear your DNS cache can help you troubleshoot connection issues and stay in control of your data.
Average DNS cache size on Windows: 10 MB · Default TTL for DNS records: 3600 seconds (1 hour) · Time saved per DNS lookup with cache: 10–100 ms · Number of DNS cache entries on a typical device: Hundreds to thousands
Quick snapshot
- DNS cache stores IP addresses of recently visited domains (Microsoft Learn, the Windows server documentation)
- Flushing DNS cache clears all stored entries without affecting passwords or browsing history (Apple Support, the official macOS guidance)
- Clearing DNS cache resolves many connectivity issues caused by corrupted entries (DigiCert, a leading certificate authority)
- The exact impact of clearing DNS cache on browser performance after flushing is temporary and varies (NHIMG, an operational IT resource)
- Whether DNS cache on mobile devices can be viewed without root access is not universally documented (Apple Support Community, user discussion)
- Apple updated its DNS cache reset commands for macOS 10.10.4+ in 2015, and the guidance remains current (Apple Support, updated page)
- Microsoft’s Clear-DnsClientCache command has been part of Windows PowerShell for years, unchanged in recent releases (Microsoft Learn, current documentation)
- Expect more operating systems and browsers to offer granular DNS cache controls for privacy and troubleshooting (Google Public DNS documentation, the DNS resolver guide)
- Security research continues to focus on preventing cache poisoning attacks that exploit stale entries (DigiCert, the certificate authority FAQ)
| Label | Value |
|---|---|
| DNS cache stores | IP addresses of recently visited domains |
| TTL (time-to-live) | Determines how long a record is cached before refresh |
| Flushing DNS cache | Clears all stored entries, forcing fresh lookups |
| DNS cache poisoning | Attack that injects malicious IP mappings into the cache |
| System affected | All operating systems, routers, and browsers |
| Impact of stale cache | Website not found errors, redirection to wrong IPs |
What is DNS cache and how does it work?
Every time you visit a website, your device performs a DNS lookup to translate the human-readable domain name (like example.com) into a machine-readable IP address. The DNS cache stores that mapping locally so the next time you visit the same site, the lookup can be skipped—saving 10–100 milliseconds per request (KeyCDN, a content delivery network).
How DNS caching improves browsing speed
- Reduces the number of queries sent to external DNS servers, lowering network latency.
- Prevents redundant lookups for frequently visited domains, making page loads feel snappier.
- Helps websites load faster on slower connections by avoiding repeated round trips.
The pattern: DNS cache is a local copy of the phonebook of the internet, and using it avoids redialing directory assistance every time.
The role of TTL (time-to-live)
Each cached DNS record includes a TTL—a timer set by the domain owner that tells the cache how long to keep the entry before discarding it and re-querying. The default TTL is often 3600 seconds (one hour), but it can range from a few minutes to several days (Microsoft Learn, the PowerShell documentation).
A longer TTL keeps your browsing faster by reducing lookups, but it also means stale IP addresses linger longer after a site moves servers. Administrators balance speed against freshness by setting TTL values that match how often their infrastructure changes.
What this means: TTL is the cache’s expiration date, and understanding it helps you decide when flushing might be needed—without it, you may keep hitting a dead or wrong address for hours.
Is it safe to clear DNS cache?
Yes, clearing your DNS cache is safe. It does not delete any personal files, passwords, bookmarks, or browsing history. The process, sometimes called flushing, simply removes the temporary IP address records stored by your device or browser (Apple Support, the official macOS guidance).
When flushing DNS cache is recommended
- After a website changes its IP address and you still see the old version or an error.
- When you encounter “website not found” errors that other devices on the same network don’t see.
- After troubleshooting a malware or cache poisoning incident to remove any malicious entries.
Potential temporary slowdown after clearing
Immediately after flushing, your device has no cached IP records, so the next few domain lookups will require full DNS queries—adding a small delay (10–100 ms each) until the cache rebuilds. This is normally unnoticeable in practice (DigiCert, the certificate authority FAQ).
Flushing is a maintenance task, not a privacy cure-all. While it can clear poisoned entries, it does not stop future poisoning—your device will simply re-fetch records from the same DNS server. Layering a secure DNS service like DNSSEC provides stronger protection.
The implication: Flushing is safe and often helpful, but don’t expect it to solve every connectivity issue or to boost your privacy on its own.
How do I check my DNS cache?
Checking your DNS cache lets you see what domain-to-IP mappings are currently stored. The method depends on your operating system. Two rows illustrate the dominant patterns.
Check DNS cache on Windows using Command Prompt
- Open Command Prompt as Administrator (right-click Start menu, choose “Command Prompt (Admin)”).
- Type
ipconfig /displaydnsand press Enter. - Scroll through the list of cached records showing domain name, TTL, and IP address.
Microsoft provides the ipconfig /displaydns command as a built-in tool for viewing the DNS client cache (Microsoft Learn, the Windows networking documentation).
Check DNS cache on macOS using Terminal
- Open Terminal (Finder > Go > Utilities > Terminal).
- Type
sudo killall -INFO mDNSResponder(for macOS 10.10.4+) and press Enter. - For older versions, use
sudo dscacheutil -cachedump(UCSF IT, the university tech support guide).
View DNS cache on Android and iPhone
Mobile devices—both Android and iOS—do not expose a built-in command to view the DNS cache directly. On Android, users typically need root access or a third-party app. On iPhone, restarting the device effectively clears the cache but viewing it is not possible with stock tools (Apple Support Community, user discussion).
The catch: Windows and Mac users have straightforward commands, but mobile users are left with limited visibility. If you suspect a stale cache on your phone, a restart is the simplest workaround.
Does clearing DNS cache delete history?
No—clearing your DNS cache does not delete browser history, bookmarks, saved passwords, or any other personal data. It only removes the temporary IP address records stored from previous DNS lookups (KeyCDN, the CDN performance resource).
Difference between DNS cache and browser history
- Browser history: A list of URLs you visited, stored by the browser (Chrome, Firefox, etc.). Clearing it removes the visible log but not DNS cache entries.
- DNS cache: A system-level store of IP addresses, managed by the operating system or browser. It contains no URLs, passwords, or timestamps.
What clearing DNS cache actually removes
It deletes only the mapping data—for example, that google.com equals 142.250.190.78. The browser still retains its own cache of page resources, cookies, and history separately (Google Public DNS documentation, the DNS service guide).
The pattern: DNS cache and browser history live in different houses on the same street. Clearing one has no effect on the other, so you can flush without worry.
Should I enable DNS cache?
In nearly all cases, yes. DNS caching is enabled by default on every major operating system and browser because the performance benefits—reduced lookup times and lower server load—are substantial. However, there are edge cases where disabling or flushing is advisable.
Pros of keeping DNS cache enabled
- Faster browsing speeds: repeated lookups skip the query step altogether.
- Reduced network traffic: fewer DNS queries mean less load on your internet connection and public DNS servers.
- Better user experience: page loads feel instantaneous for sites you visit regularly.
Cons of enabling DNS cache
- Stale data risk: if a site’s IP changes before TTL expires, you may hit an old address.
- Cache poisoning vulnerability: an unsecured cache can be manipulated to redirect traffic to malicious sites.
- Minor memory usage: the cache occupies a few megabytes of RAM, though this is negligible on modern devices.
When to disable or flush DNS cache
Disabling DNS cache entirely is rarely necessary. The standard practice is to flush the cache when you encounter connectivity problems after a site move, or as a troubleshooting step. Security experts from DigiCert note that periodic flushing is a maintenance step for stale resolution rather than a general security control (DigiCert, the certificate authority FAQ).
Keep DNS cache enabled for daily use, but flush it when you suspect corruption or after you’ve changed your DNS server settings. Disabling it altogether trades speed for a near-invisible security gain—most users should stick with the default.
Upsides
- Faster repeat visits to websites
- Reduced DNS server load
- Lower network latency
- No impact on passwords or history
Downsides
- Can serve stale IP addresses
- Vulnerable to cache poisoning attacks
- Occasional need to manually flush
- Limited visibility on mobile devices
How to Flush DNS Cache (Windows, Mac, Chrome)
Flushing the DNS cache is a straightforward process. The commands vary by platform, but the principle is the same: delete the local cache so the next lookup fetches fresh records.
Flush DNS cache on Windows
- Open Command Prompt as Administrator.
- Type
ipconfig /flushdnsand press Enter. - You should see the confirmation message: “Successfully flushed the DNS Resolver Cache.”
Microsoft’s Clear-DnsClientCache PowerShell cmdlet does the same thing and is equivalent to ipconfig /flushdns (Microsoft Learn, the Windows PowerShell documentation).
Flush DNS cache on macOS
- Open Terminal.
- For macOS 10.10.4 and later (including Sonoma 14), type
sudo killall -HUP mDNSResponderand press Enter. - Enter your admin password when prompted, then press Return. No confirmation message appears, but the cache is cleared instantly.
Apple’s official page provides version-specific commands; for older systems like El Capitan 10.11, the command sudo dscacheutil -flushcache was used (Apple Support, the macOS DNS reset guidance).
Flush DNS cache in Google Chrome
- Type
chrome://net-internals/#dnsin the address bar and press Enter. - Click the “Clear host cache” button. This removes Chrome’s own DNS cache, separate from the system cache.
Microsoft’s support content confirms that Edge has a similar internal cache accessible via edge://net-internals/#dns (Microsoft Q&A, the Windows support forum).
The pattern: three platforms, one goal. After flushing, your device will rebuild the cache gradually over the next few minutes.
Confirmed facts
- Flushing DNS cache resolves many connectivity issues caused by corrupted entries (DigiCert, the certificate authority FAQ).
- DNS cache does not contain passwords, browsing history, or personal files (Apple Support, the official macOS guidance).
- Enabling DNS cache reduces latency for repeated domain lookups (KeyCDN, the CDN performance resource).
What’s unclear
- The exact impact of clearing DNS cache on browser performance after flushing is temporary and varies by device and network (NHIMG, an operational IT resource).
- Whether DNS cache on mobile devices can be viewed without root access is not universally documented (Apple Support Community, user discussion).
“DNS cache is temporary storage of DNS lookup results on your device or browser. It maps domain names to IP addresses to avoid repeated queries to a DNS server.”
— Akamai glossary, the global CDN and cloud provider
“To flush the DNS cache on Windows, open Command Prompt and run ipconfig /flushdns. This clears the local resolver cache.”
— Microsoft support documentation, the Windows operating system developer
“Google Public DNS users can flush their cache by visiting the control panel, but local system cache must be cleared separately using operating system commands.”
— Google Public DNS documentation, the public DNS resolver service
“DNS cache is a temporary database of DNS records that a computer or browser maintains. Flushing it forces the system to query the DNS server for the latest information.”
— KeyCDN support article, the content delivery network resource
The stakes are practical rather than dramatic. For everyday users, leaving DNS cache on is the right default. For anyone who encounters a “website not found” error after a site migration or sees a suspicious redirect, the first step should be a two-second flush command. For system administrators managing multiple machines, scripting the flush across endpoints ensures stale records don’t cause intermittent outages.
learn.microsoft.com, youtube.com, learn.microsoft.com, appleinsider.com, discussions.apple.com, youtube.com
For a detailed breakdown of how DNS cache works and whether it’s safe to clear, see this DNS cache definition and safety guide.
Frequently asked questions
Does flushing DNS cache affect my browsing history?
No. Flushing DNS cache removes only IP address mappings, not your browser history, bookmarks, or saved passwords (KeyCDN, the CDN performance resource).
Can DNS cache be cleared automatically?
Yes—the cache clears automatically when each record’s TTL expires. You can also configure your operating system or firewall to clear the cache on reboot or at scheduled intervals.
How often does DNS cache expire?
It depends on the TTL set by the domain owner. The default is usually 3600 seconds (1 hour), but some domains set TTL as low as 30 seconds or as high as 86400 seconds (24 hours).
What is DNS cache poisoning?
It is an attack where a malicious actor injects fake DNS records into a resolver’s cache, redirecting users to fraudulent websites. Flushing the cache removes those bad entries (DigiCert, the certificate authority FAQ).
How to flush DNS cache on Mac?
Open Terminal and run sudo killall -HUP mDNSResponder (for macOS 10.10.4 and later). For older versions, use sudo dscacheutil -flushcache (Apple Support, the macOS DNS reset guidance).
Does clearing DNS cache improve internet speed?
Not permanently. After flushing, initial lookups may be slightly slower until the cache rebuilds. The long-term benefit is resolving connectivity issues caused by stale or corrupted entries, not a raw speed boost.
Is there a difference between DNS cache and browser cache?
Yes. DNS cache stores IP addresses (domain<->IP mapping). Browser cache stores page resources (images, CSS, scripts) to speed up page rendering. They are separate systems with separate clearing methods.