Blog

How to Flush Your DNS Cache

Clear your DNS cache to fix website loading errors, resolve DNS propagation issues, and improve connection reliability. Step-by-step for every platform.

Published September 16, 2026 · Updated September 16, 2026

Why Flush Your DNS Cache

Your device stores DNS lookup results locally to speed up future visits to the same website. This cache avoids re-querying the DNS server every time. However, cached entries can become outdated or corrupted, causing problems.

The most common reasons to flush the DNS cache are: a website changed its IP address but your device still has the old one cached; you changed DNS providers and your device is still using old results; you are seeing "server not found" or DNS_PROBE_FINISHED_NXDOMAIN errors; DNS records are propagating after a migration and you want to force a refresh; or you suspect DNS cache poisoning. See our full DNS cache explained guide.

Windows Instructions

Windows 10 / 11 — Command Prompt

Open Command Prompt as Administrator. Right-click the Start button and select "Terminal (Admin)" or "Command Prompt (Admin)." Type the following command and press Enter:

ipconfig /flushdns

You should see the message "Successfully flushed the DNS Resolver Cache." The command completes instantly. No restart is required.

Windows — PowerShell

Open PowerShell as Administrator. Type the following command and press Enter:

Clear-DnsClientCache

This achieves the same result. See our full Windows DNS flushing guide with screenshots.

Windows — Viewing the Cache

To see what is currently cached, run ipconfig /displaydns in Command Prompt. This shows all stored DNS entries, which can be useful for troubleshooting. See our complete DNS guide for more.

Mac Instructions

macOS Ventura and Later

Open Terminal (search for "Terminal" in Spotlight). Type the following command and press Enter:

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

You will be prompted for your Mac password. Enter it (characters will not appear on screen) and press Enter. The command flushes both the DNS cache and the mDNSResponder service. No restart is needed.

macOS Monterey and Earlier

The same command works on older macOS versions. The mDNSResponder flush covers all DNS caching layers on macOS. See our full Mac DNS flushing guide.

Linux Instructions

systemd-resolved (Ubuntu, Fedora, Most Modern Distros)

Open a terminal and run:

sudo systemd-resolve --flush-caches

On newer systems, use resolvectl flush-caches. To verify, run resolvectl statistics and check that the cache size is zero.

nscd (Older Systems)

If your system uses nscd for DNS caching, run:

sudo systemctl restart nscd

Or on SysVinit systems: sudo /etc/init.d/nscd restart

Dnsmasq

If you run Dnsmasq locally, flush its cache with:

sudo kill -HUP $(pidof dnsmasq)

See our full Linux DNS flushing guide for your specific distribution.

iPhone / iPad Instructions

iOS 17 and Later

Apple does not provide a direct command to flush DNS cache on iOS. The simplest method is to toggle Airplane Mode. Open Control Center, tap the airplane icon to enable Airplane Mode, wait 15 seconds, then tap it again to disable it. This resets the network stack and clears the DNS cache.

Alternative Method

You can also go to Settings, tap General, tap Transfer or Reset iPhone, tap Reset, and select "Reset Network Settings." This clears Wi-Fi passwords, cellular settings, and the DNS cache. Only use this if the Airplane Mode method does not work.

Private DNS on iOS

iOS 14 and later support DNS-over-HTTPS at the Wi-Fi level. Go to Settings, tap Wi-Fi, tap the info icon next to your network, tap Configure DNS, and switch to Manual or Automatic with a DoH provider. See our private DNS guide for details.

Router DNS Cache

Many routers maintain their own DNS cache separate from your devices. If you changed DNS providers and your devices are still using old results, the router cache may be the cause. Flushing the device cache alone may not be enough.

To flush your router's DNS cache, log into your router's admin page (usually at 192.168.1.1 or 192.168.0.1), look for DNS settings or advanced options, and find a "flush cache" or "clear DNS cache" option. Some routers require a reboot to clear the cache — simply unplug the router for 30 seconds and plug it back in.

After flushing both device and router caches, run our DNS leak test to verify everything is working correctly. See our complete DNS cache flushing guide for router-specific instructions.

Frequently Asked Questions

What does flushing the DNS cache do?

Flushing the DNS cache deletes all stored DNS lookup results on your device. This forces your device to request fresh DNS records the next time you visit a website. This is useful when a website has changed its IP address, when DNS records are propagating after a change, when you are experiencing DNS errors, or after changing your DNS provider settings.

Is it safe to flush DNS cache?

Yes, flushing the DNS cache is completely safe and has no side effects. Your device will simply re-fetch DNS records the next time you visit a website, which may add a small fraction of a second to the first visit. There is no risk of data loss, system damage, or configuration changes. It is a routine troubleshooting step that network administrators use regularly.

How often should I flush my DNS cache?

You do not need to flush your DNS cache on a regular schedule. DNS records have built-in TTL (time to live) values that automatically refresh. You should flush your DNS cache when you experience specific problems: a website shows outdated content, you get DNS errors, you changed DNS providers, you changed your own domain's DNS records, or you suspect DNS poisoning. Most users only need to flush once every few months or when troubleshooting.

Does flushing DNS cache speed up the internet?

Flushing the DNS cache does not speed up the internet. In fact, the first few website visits after flushing will be slightly slower because your device has to re-fetch all DNS records from scratch. Flushing is for fixing problems (wrong addresses, DNS errors), not for speed improvement. To actually speed up DNS resolution, switch to a faster DNS provider like Cloudflare 1.1.1.1 — see our DNS speed test at dnsbench.pp.ua.

Test Your DNS Speed

Find the fastest DNS server for your location with our free benchmark tool.

Run DNS Speed Test