How to flush DNS: A complete guide for privacy and speed

Learn how to flush DNS on Windows, Mac, Linux, iPhone, and Android. Improve speed, fix errors, and strengthen privacy with VPN leak protection.

5 mins read
Nym Connection Blog Image
Share

If your internet suddenly feels sluggish, pages don’t load correctly, or you keep getting redirected to the wrong site, the issue may not be your browser or Wi-Fi, it could be your DNS cache. Performing a DNS flush is one of the easiest ways to clear outdated records, restore proper connections, and even strengthen your digital privacy.

In this guide, you’ll learn exactly how to flush DNS on Windows, Mac, Linux, iPhone, and Android, plus why it matters for your online privacy. We’ll also explain how tools like NymVPN take protection a step further by securing your DNS traffic against surveillance and leaks.

80% off today

The world's most private VPN

What is a DNS flush?

Every time you type in a website, your device queries a DNS server to translate the domain name into a numeric IP address. To speed things up, your computer or phone stores those results locally in a DNS cache.

Over time, however, that cache can become outdated or corrupted. A DNS flush clears the stored entries, forcing your device to fetch fresh records. Think of it as refreshing the address book your system uses to find websites.

If you’re curious about how DNS plays into surveillance, see our explainer on who is tracking your internet activity.

How to flush DNS on different devices

  • Open the Start menu, search for Command Prompt, right-click and choose Run as Administrator
  • Type ipconfig /flushdns.
  • You should see confirmation that the cache was cleared. macOS
  • Open Terminal and enter: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  • You won’t see a message, but the cache is flushed.

  • Entert: *sudo systemd-resolve --flush-caches
  • Check with: systemd-resolve --statistics

Other distributions may use nscd or dnsmasq.

The quickest method is toggling Airplane Mode off and on, or simply restarting your device.

You can also clear Safari’s browsing history in Settings > Safari.

Android

  • Restart your phone or toggle Airplane Mode.

On some devices, clearing browser cache or resetting network settings also flushes DNS.

If you want a more thorough reset, see our guide on Android factory resets.

Why flushing DNS improves privacy

Most people flush DNS to fix broken connections, but it also benefits privacy. Your DNS cache can act like a record of sites you’ve visited. While it’s not as obvious as browser history, malware or local attackers can still read it.

Flushing the cache wipes those traces and helps block DNS spoofing attacks that redirect traffic to malicious servers. Still, remember: a DNS flush only clears local history. Your ISP can still see live DNS queries unless you protect them with a VPN.

Learn more in our guide to DNS leaks.

This is where NymVPN stands out. Unlike standard VPNs that just encrypt DNS requests, Nym uses a Noise Generating Mixnet to hide both DNS content and metadata. That means observers can’t infer who you’re talking to or when—a major upgrade in privacy. See our full explanation of what a mixnet is.

Nym's Noise Generating Mixnet

DNS flush vs. changing DNS servers

It’s important not to confuse flushing DNS with changing DNS servers. Flushing clears cached entries; switching servers means pointing your device to a different resolver like Google DNS or Cloudflare.

Changing servers can improve speed, but it doesn’t guarantee privacy since those providers still log queries. The best defense is using a VPN with DNS leak protection.

How often should you flush DNS?

There isn’t a set rule, but it’s a good idea whenever you notice connectivity issues, after switching DNS servers, or if you want to erase traces of browsing from your device.

For privacy-minded users, flushing DNS periodically plus keeping NymVPN on at all times ensures you’re both cleaning old data and protecting new activity.

DNS flushing improves online privacy

Clearing your DNS cache is a simple but effective way to clean up browsing traces, resolve connection issues, and defend against spoofing attacks. While a DNS flush alone won’t make you invisible online, it’s a valuable step in reducing the digital footprints left on your device.

For stronger, ongoing protection, you need more than a manual cleanup. Pairing regular DNS flushes with privacy-first tools like NymVPN ensures that your DNS queries are encrypted, anonymized, and shielded from surveillance at the network level. With Nym’s mixnet technology, your metadata stays hidden, closing the privacy gaps traditional VPNs leave exposed.

Earlybird-email banner (1).webp

DNS flushing: FAQs

It can fix misdirected queries caused by DNS tampering, but it won’t stop network-level censorship. Using tools like VPNs or mixnets is essential for bypassing restrictions.

No. A flush clears cache entries, which may remove malicious redirects, but it won’t eliminate malware on your system. You’ll need dedicated security tools.

On mobile devices, DNS flushing usually happens through reboots or toggling Airplane Mode. Desktops require commands or Terminal, making the process more deliberate.

Yes. Flushing only clears your local cache. Employers monitoring workplace networks can still view live DNS lookups unless you use encryption and VPN protection.

You may not notice at first, but cached data can cause connection errors over time, enable spoofing attacks, and leave behind traces of browsing history that compromise privacy.

Keep Reading...

Nym Connection Blog Image
3 mins read
Nym Connection Blog Image

DNS server not responding? How to fix it on any device

Learn what causes DNS errors, how to fix them fast, and how to protect your DNS traffic with privacy tools

7 mins read
nym network.webp

Nym is more than a VPN

The first app that protects you from AI surveillance thanks to a noise-generating mixnet

8 mins read
Pablo: Improve quality

Can you be tracked while using a VPN?

VPNs are great privacy tools, but you can still be tracked. Choose the right type of VPN to avoid it.

6 mins read