How to Flush DNS Cache on Every Platform
Step-by-step instructions to flush DNS cache on Windows, macOS, Linux, Chrome, Firefox, Safari, and routers. Learn when and why to clear your DNS cache.
Last updated: 2026-02-17
Your computer, browser, and router all cache DNS responses to speed up repeated lookups. Most of the time, this caching is invisible and beneficial. But when DNS records change, caches can serve stale data, making it look like your update did not work or causing you to reach the wrong server.
Flushing your DNS cache forces your system to discard stored DNS responses and fetch fresh data from upstream resolvers. This guide covers how to flush the DNS cache on every major platform, when you should do it, and when flushing alone is not enough.
Why DNS Caching Exists
Every DNS lookup involves multiple network requests: your device queries a recursive resolver, which may query root servers, TLD servers, and authoritative nameservers. This process takes time, typically 20-100 milliseconds.
Caching eliminates this latency for repeated queries. When you visit a website, the resolved IP address is cached at multiple levels:
- Browser cache: Chrome, Firefox, Safari, and Edge all maintain their own DNS caches
- Operating system cache: Windows, macOS, and Linux cache DNS responses at the system level
- Router cache: Many home and office routers cache DNS responses for all devices on the network
- Recursive resolver cache: Your ISP or public DNS resolver (like 8.8.8.8) caches responses based on TTL
Each layer has its own cache, and flushing one does not clear the others. For a complete refresh, you may need to flush at multiple levels.
When to Flush DNS Cache
Flushing DNS is appropriate in these situations:
After making DNS changes
When you update a DNS record and want to verify the change from your own machine, flushing the local cache ensures you are not seeing stale data.
When a site resolves to the wrong IP
If your machine is reaching an old server after a migration or IP change, a cached stale record is the likely cause.
During DNS troubleshooting
When diagnosing DNS issues, clearing the cache eliminates caching as a variable. You need to see what the live DNS returns, not what was cached hours ago.
After changing DNS servers
If you switch your machine from your ISP's DNS to a public resolver like Cloudflare (1.1.1.1) or Google (8.8.8.8), flush the cache so the old resolver's responses do not persist.
Flushing cache does not speed up propagation
Flushing your local cache only affects what your machine sees. It does not make DNS changes propagate faster globally. If a record has not propagated to your upstream resolver yet, flushing your local cache will just re-fetch the same old data from that resolver.
Flush DNS Cache on Windows
Windows 10 and Windows 11
Open Command Prompt or PowerShell as Administrator
Right-click the Start button and select "Terminal (Admin)" or "Command Prompt (Admin)". You need administrator privileges to flush the DNS cache.
Run the flush command
Type the following command and press Enter:
ipconfig /flushdns
You should see: Successfully flushed the DNS Resolver Cache.
To verify the cache was cleared, you can view the current cache contents:
ipconfig /displaydns
After flushing, this should show very few or no entries.
Windows DNS Client Service Restart
If flushing alone does not resolve the issue, restart the DNS Client service:
net stop dnscache
net start dnscache
Flush DNS Cache on macOS
The command differs depending on your macOS version, but the following works on macOS Monterey, Ventura, Sonoma, and Sequoia:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
You will be prompted for your administrator password. There is no confirmation message, but the cache is flushed immediately.
Both commands are needed on macOS
The dscacheutil -flushcache command clears the directory service cache, and killall -HUP mDNSResponder resets the mDNS responder which handles DNS resolution. Running both ensures a complete flush.
Older macOS Versions
| macOS Version | Command |
|---------------|---------|
| Sequoia / Sonoma / Ventura / Monterey | sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder |
| Big Sur | sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder |
| Catalina / Mojave / High Sierra | sudo killall -HUP mDNSResponder |
| Sierra | sudo killall -HUP mDNSResponder |
| El Capitan | sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder |
Flush DNS Cache on Linux
Linux distributions use different DNS caching services. Identify which one you are running and use the corresponding command.
systemd-resolved (Ubuntu 18.04+, Fedora, Arch)
sudo systemd-resolve --flush-caches
Or on newer versions:
sudo resolvectl flush-caches
To verify:
sudo resolvectl statistics
The cache size should show 0 after flushing.
nscd (Name Service Cache Daemon)
sudo systemctl restart nscd
Or:
sudo nscd -i hosts
dnsmasq
sudo systemctl restart dnsmasq
No local caching
Some Linux configurations do not cache DNS locally at all. If you are not running systemd-resolved, nscd, or dnsmasq, there may be no local cache to flush. Your DNS queries go directly to the configured resolver.
Go Beyond Cache Flushing
Instead of manually flushing and checking DNS, let DNS Monitor verify your records automatically from multiple global locations and alert you to issues in real time.
Flush DNS Cache in Web Browsers
Browsers maintain their own DNS caches separate from the operating system. Flushing the OS cache does not clear the browser cache.
Google Chrome
Navigate to chrome://net-internals/#dns in the address bar and click "Clear host cache."
Also clear the socket pool at chrome://net-internals/#sockets by clicking "Flush socket pools." Persistent connections can bypass DNS even after cache clearing.
Mozilla Firefox
- Open the hamburger menu and go to Settings
- Search for "cache" in the settings search bar
- Click "Clear Data" and select "Cached Web Content"
Alternatively, type about:networking#dns in the address bar to see cached DNS entries and use the "Clear DNS Cache" button.
Safari
Safari does not expose a DNS cache clearing option directly. Clearing the browser cache via Safari > Settings > Privacy > Manage Website Data removes cached resources but may not clear DNS. Flushing the macOS system DNS cache is the reliable approach for Safari.
Microsoft Edge
Navigate to edge://net-internals/#dns and click "Clear host cache," similar to Chrome.
Flush DNS Cache on Routers
Your router likely caches DNS responses for all devices on your network. Flushing it ensures every device gets fresh DNS data.
Most Consumer Routers
The simplest approach is to restart the router. Power it off, wait 10 seconds, and power it back on. This clears the DNS cache along with all other cached data.
Router Admin Panel
Some routers offer a DNS cache flush option in their web admin interface. Access it at 192.168.1.1 or 192.168.0.1 (varies by manufacturer) and look for DNS settings.
Enterprise Routers and Firewalls
Enterprise equipment like pfSense, Ubiquiti, or Cisco devices has specific DNS cache management commands. Consult your device's documentation for the correct procedure.
Complete DNS Cache Flush Checklist
For a thorough flush when troubleshooting a stubborn DNS issue:
| Layer | Action | Clears Cache For |
|---|---|---|
| Browser | Clear browser DNS cache | Current browser only |
| Operating System | Run OS-specific flush command | All applications on this device |
| Router | Restart router or clear via admin panel | All devices on this network |
| Public Resolver | Switch to a different resolver temporarily | Your queries only |
You cannot flush your ISP's resolver cache
If your ISP's DNS resolver has a stale cached record, you cannot force it to refresh. Your options are to wait for the TTL to expire or switch your device to use a different resolver like Google (8.8.8.8) or Cloudflare (1.1.1.1).
When Flushing Is Not Enough
If you have flushed at every level and still see old DNS data:
- The upstream resolver has a stale cache: Switch to a different public resolver temporarily
- The record has not actually changed: Query the authoritative nameserver directly to confirm the update was applied
- Negative caching: If a record was queried before it was created, the NXDOMAIN response is cached. The SOA minimum TTL determines how long negative responses persist
- Application-level caching: Some applications cache DNS independently (Java, for example, caches DNS aggressively by default). Restarting the application may be necessary
Flushing DNS cache is a quick fix for stale resolution, but it is a diagnostic tool, not a solution. If you find yourself flushing caches regularly, the underlying issue is usually TTL misconfiguration or a lack of automated DNS monitoring that would catch problems at the source.
Stop Chasing Stale Cache Issues
DNS Monitor verifies your records from multiple resolvers worldwide, giving you instant visibility into what the internet actually sees for your domain.