Why Flush Your DNS Cache?
Your operating system caches DNS lookups to speed up browsing. When you visit a website, the resolved IP address is stored locally so future visits don't require a full DNS resolution. This is efficient — but it can also cause problems.
The most common reasons to flush your DNS cache include:
- You've just updated DNS records for a domain and want to see the changes immediately without waiting for the TTL to expire.
- A website is unreachable even though others can access it — your cached record may be stale or corrupted.
- You're getting a wrong IP address for a domain after it was migrated to a new server.
- DNS cache poisoning is suspected — your cache may contain malicious records injected by an attacker.
- Privacy concerns — clearing the cache removes the local record of domains you've visited.
Flushing the DNS cache is safe and will not cause any lasting harm. The cache will simply be rebuilt as you browse. After flushing, run a DNS leak test to confirm your resolver is responding correctly.
Flush DNS Cache on Windows 10 and Windows 11
Windows stores DNS cache in the DNS Client service. Flushing it requires running a single command in an elevated Command Prompt or PowerShell.
Method 1: Command Prompt
- Press Win + R, type
cmd, then press Ctrl + Shift + Enter to open as Administrator. - Type the following command and press Enter:
ipconfig /flushdns - You should see: "Successfully flushed the DNS Resolver Cache."
Method 2: PowerShell
Clear-DnsClientCache
Run this in an elevated PowerShell window. No output means success.
Additional useful commands:
# View current DNS cache contents
ipconfig /displaydns
# Release and renew your IP address (resets network state)
ipconfig /release
ipconfig /renew
# Reset Winsock (fixes network stack corruption)
netsh winsock reset
After flushing, you can verify a domain resolves to the expected IP using nslookup example.com or check it with our IP lookup tool.
Flush DNS Cache on macOS
The command to flush DNS on macOS varies depending on your OS version. Here are the commands for all recent versions:
macOS Ventura, Monterey, Big Sur (macOS 11–13+):
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
You'll be prompted for your administrator password. No output means success.
macOS Catalina, Mojave, High Sierra (macOS 10.13–10.15):
sudo killall -HUP mDNSResponder
macOS Sierra and El Capitan (macOS 10.11–10.12):
sudo killall -HUP mDNSResponder
sudo dscacheutil -flushcache
How to open Terminal on Mac:
- Press Cmd + Space to open Spotlight.
- Type "Terminal" and press Enter.
- Paste the appropriate command for your macOS version.
- Enter your password when prompted.
After flushing, you can verify DNS resolution by running nslookup example.com in Terminal, or by using our DNS leak test.
Flush DNS Cache on Linux
Linux DNS caching depends on which DNS caching service is running on your system. Different distributions use different services:
systemd-resolved (Ubuntu 17.04+, Fedora, Arch):
sudo systemd-resolve --flush-caches
Verify it worked: sudo systemd-resolve --statistics — look for "Current Cache Size: 0".
nscd (Name Service Cache Daemon):
sudo systemctl restart nscd
# or
sudo service nscd restart
dnsmasq:
sudo systemctl restart dnsmasq
Not sure which one you have? Run:
systemctl list-units --type=service | grep -E 'nscd|resolved|dnsmasq'
If no caching daemon is running, your Linux system may rely entirely on your router or ISP resolver, in which case local flushing isn't applicable. You can still force a fresh lookup by using dig +nocache example.com.
Flush DNS Cache in Web Browsers
Web browsers maintain their own DNS caches independently from the OS. Even after flushing the system cache, your browser may still serve stale DNS data. Here's how to flush the cache in each major browser:
Google Chrome and Microsoft Edge (Chromium-based):
- Open a new tab and navigate to:
chrome://net-internals/#dns(oredge://net-internals/#dns) - Click the "Clear host cache" button.
- Optionally, go to
chrome://net-internals/#socketsand click "Flush socket pools" to close existing connections.
Mozilla Firefox: Firefox does not expose a standalone DNS flush button. The most reliable way is:
- Go to Settings → Privacy & Security → Cookies and Site Data.
- Click "Clear Data" and check "Cached Web Content".
- Alternatively, restart Firefox after flushing the OS cache.
Safari: Go to Develop → Empty Caches. If the Develop menu isn't visible, enable it in Settings → Advanced → "Show Develop menu in menu bar".
If you're still having DNS issues after flushing all caches, consider changing your DNS server to a reliable public resolver like Cloudflare (1.1.1.1) or Google (8.8.8.8).
Check Your DNS After Flushing
Run our DNS leak test to verify your DNS settings are working correctly
Hide My IP Now
Frequently Asked Questions
Is it safe to flush the DNS cache?
Yes, completely safe. Flushing the DNS cache simply removes stored IP address lookups. Your system will rebuild the cache automatically as you browse. There are no permanent side effects — it's a routine troubleshooting step.
How often should I flush my DNS cache?
There's no need to flush it on a schedule. Only flush it when troubleshooting connectivity issues, after updating DNS records for a domain you manage, or if you suspect stale or malicious cache entries. For routine browsing, the cache expires automatically via TTL.
Flushing DNS didn't fix my problem — what next?
If flushing DNS doesn't help, try: (1) switching to a different DNS server like <code>1.1.1.1</code> or <code>8.8.8.8</code>, (2) running a <a href="/dns-leak-test">DNS leak test</a> to check your resolver, (3) clearing your browser cache, (4) disabling any VPN or proxy, or (5) restarting your router.
Does flushing DNS improve privacy?
Partially. Flushing the local DNS cache removes locally stored records of domains you've visited, but your ISP and DNS resolver still have logs of your queries. For real DNS privacy, use <a href="/dns-over-https-explained">DNS over HTTPS</a> with a privacy-focused resolver, and run a <a href="/dns-leak-test">DNS leak test</a> to verify.
