ForestVPN

Flush DNS Fast: Clear Stale Cache on Windows, macOS, Linux

Stale DNS entries slow your browsing. Learn how to flush DNS on Windows, macOS, and Linux to quickly resolve loading issues and restore proper site access.

16 мин чтения
Flush DNS Fast: Clear Stale Cache on Windows, macOS, Linux

We’ve all stared at a site that stubbornly loads an old version, like a ghost refusing to move on. That’s DNS caching, the invisible librarian that remembers where every web page lives. Ever wonder why a brand‑new blog post still points to a 2019 IP address? The cache is the culprit.

How DNS Caching Messes With Your Browsing

DNS caching speeds up the internet by storing address lookups locally. It’s like keeping a phone book in your pocket instead of dialing every time. When a domain changes, the cached entry becomes stale, and browsers keep hitting the wrong server.

Symptoms of Stale Entries

  • Pages load slowly or fail entirely.
  • You’re redirected to an old site or an error page.
  • Network tools show outdated IPs.
  • Passwords and secure connections refuse to work.

Why Flushing Helps

Flushing the cache forces your system to re‑query DNS servers, giving you the fresh, accurate IP address. It’s like clearing a foggy window—sudden clarity, faster loading, fewer errors. We’ve seen home users regain access to streaming services in seconds after a quick flush.

Flushing DNS on Different Platforms

OS

Command / Action

Windows

ipconfig /flushdns

macOS

sudo killall -HUP mDNSResponder

Linux (Fedora)

sudo systemd-resolve --flush-caches

Android

Toggle airplane mode or use a DNS‑flush app

Windows

  1. Open Command Prompt as Administrator.
  2. Run: ipconfig /flushdns.
  3. Restart your browser.

macOS

  1. Open Terminal.
  2. Run: sudo killall -HUP mDNSResponder.
  3. Enter your password when prompted.

Linux (Fedora)

  1. Open Terminal.
  2. Run: sudo systemd-resolve --flush-caches.
  3. Verify with systemd-resolve --statistics.

Android

  1. Go to Settings > Connections > Wi‑Fi.
  2. Long‑press the connected network and choose Forget.
  3. Re‑connect, or toggle Airplane mode off and on.

Verify the Flush

  • nslookup: nslookup example.com – should return the current IP.
  • ping: ping example.com – should resolve to the new address.
  • Check the timestamp of the DNS entry with dig example.com +nocmd +trace.

Troubleshooting Persistent DNS Issues

  1. Restart your router or modem.
  2. Switch to a public DNS provider:
  • Cloudflare: 1.1.1.1 / 1.0.0.1
  • Google DNS: 8.8.8.8 / 8.8.4.4
  • Quad9: 9.9.9.9
  1. Clear the DNS cache on your device again.
  2. Disable any VPN or proxy that might be overriding DNS settings.

Forest VPN: A Quick Boost While You’re at It

While clearing DNS, many users also want a secure and private connection. Forest VPN offers a free tier with unlimited data, a paid plan with split‑tunneling, and a wide range of server locations. It’s easy to set up on Windows, macOS, Linux, and Android, and it doesn’t interfere with your DNS settings.

Why Choose Forest VPN?

  • Convenience – one‑click connect on all major platforms.
  • Affordability – free tier available, paid plan at just a few dollars a month.
  • Variety of options – choose from over 30 servers worldwide and use custom DNS if desired.

Call to Action

Ready to enjoy a faster, cleaner browsing experience? Clear your DNS cache now, then try Forest VPN for an extra layer of privacy and speed. Sign up today and experience the difference.

Step‑by‑Step: Flushing DNS on Windows – From Command Prompt to PowerShell

Why DNS Caching Matters

DNS caching is what lets your browser feel fast. It keeps a local copy of domain names, so the next time you visit a site you don’t have to ask a remote server again. When that copy drifts out of date, you might see wrong pages or nothing at all. Flushing the cache forces your computer to pull fresh data from the DNS server.

Windows

  1. Command Prompt – Open an elevated Command Prompt, type the command, and you’ll see DNS cache cleared:
typescript
1ipconfig /flushdns
  1. PowerShell – Run the equivalent:
typescript
1Resolve-DnsClientCache –Flush
  1. Advanced – Clear the resolver cache entirely:
typescript
1netsh dns flush
  1. Verify – Make sure the cache is empty:
typescript
1ipconfig /displaydns

No entries should be listed.

  1. Automation – A quick PowerShell script that flushes the cache and restarts the network adapter can be scheduled in Task Scheduler:
typescript
1ipconfig /flushdns
2 Restart-NetAdapter -Confirm:$false

macOS

  1. Open Terminal and run:
bash
1sudo killall -HUP mDNSResponder

You’ll be prompted for your password.

  1. Verify by running:
bash
1dscacheutil -flushcache

Linux (Fedora)

  1. In Terminal, execute:
bash
1sudo systemd-resolve --flush-caches
  1. If you’re using dnsmasq, restart it:
bash
1sudo systemctl restart dnsmasq
  1. Check the status with:
bash
1systemd-resolve --statistics

Android

  1. Open the Settings app.
  2. Go to Network & InternetWi‑Fi.
  3. Long‑press your connected network and choose Forget.
  4. Re‑connect; the OS will automatically clear the DNS cache.

Verification Using nslookup or ping

After flushing, confirm a domain resolves to the current IP:

bash
1nslookup example.com
2ping -c 4 example.com

If the IP returned matches your ISP or chosen DNS provider, the cache was successfully refreshed.

Troubleshooting Persistent DNS Issues

  • Router DNS Cache – Restart your router if the problem persists.
  • VPN or Firewall – Disable VPNs or check firewall rules that may block DNS queries.
  • Multiple DNS Clients – Ensure only one DNS client (e.g., system resolver) is active.
  • Static DNS Entries – Remove any static entries in /etc/hosts or the Windows hosts file that may override DNS.

Choosing a Reputable DNS Provider

Switching to a fast, privacy‑respecting provider can cut lookup times:

  • Cloudflare – 1.1.1.1 (≈1 ms RTT globally)
  • Google Public DNS – 8.8.8.8
  • Quad9 – 9.9.9.9 (threat‑blocking)
  • OpenDNS and CleanBrowsing – filtering options for families or businesses.

To change the DNS on Windows:

  1. Open Control PanelNetwork and Sharing Center.
  2. Click Change adapter settings.
  3. Right‑click your network adapter, choose Properties.
  4. Select Internet Protocol Version 4 (TCP/IPv4)Properties.
  5. Enter the preferred DNS server addresses.
  6. Click OK and Close.
  7. Restart the adapter or run ipconfig /flushdns to apply.

Take Action

Flush your DNS cache today to get rid of stale entries, speed up page loads, and keep connections reliable. If you’re managing multiple machines, automating the process with scheduled scripts keeps everyone running smoothly.


Table: DNS Flush Commands by Operating System

Operating System

Command to Flush

Command to Verify

Windows (CMD)

ipconfig /flushdns

ipconfig /displaydns

Windows (PowerShell)

Resolve-DnsClientCache –Flush

Resolve-DnsClientCache

macOS

sudo killall -HUP mDNSResponder

dscacheutil -flushcache

Linux (Fedora)

sudo systemd-resolve --flush-caches

systemd-resolve --statistics

Android

Forget Wi‑Fi network

N/A

Feel free to share your experience or ask questions in the comments below!

macOS DNS Reset Made Easy: Terminal Commands and System Settings

Ever had a site refuse to load because it keeps pointing to an old IP? On macOS, the culprit often lives inside the mDNSResponder daemon—a small background process that keeps DNS lookups humming. When a domain changes, the daemon can hold onto stale data, and you’re left with a broken link or a sluggish page load.

Clearing the Cache on macOS

Open Terminal and run:

bash
1sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

The first command wipes the resolver’s memory, while the second restarts mDNSResponder, forcing it to reload from scratch.

Verifying the Flush

To confirm the cache was cleared, run:

bash
1dscacheutil -cachedump | grep -i example.com

If the output is empty or shows a new IP, you’re good. For a quick sanity check, try nslookup example.com and compare the IP to what you expect.

macOS Sierra and Later

Apple’s modern macOS versions still use mDNSResponder, but they also run a background systemd‑resolved layer on newer releases. If you’re on Big Sur or Monterey, you can add --flush-caches to systemd-resolve for a more comprehensive wipe:

bash
1sudo systemd-resolve --flush-caches

If the cache lingers because the Network service hasn’t restarted, a quick reboot of the network stack solves the issue:

bash
1sudo ifconfig en0 down && sudo ifconfig en0 up

Windows DNS Cache

On Windows, use:

typescript
1ipconfig /flushdns

Verify with:

typescript
1nslookup example.com

Linux (Fedora) DNS Cache

For Fedora and other systemd‑based distributions, run:

bash
1sudo systemd-resolve --flush-caches

On older systems that use nscd, restart it:

bash
1sudo systemctl restart nscd

Android DNS Cache

Android doesn’t expose a direct command, but you can clear the DNS cache by:

  1. Going to Settings > Apps > [Your Browser] > Storage and tapping Clear Cache.
  2. Or simply rebooting the device.

After clearing, use a browser or app that performs a DNS query to verify.

Choosing a DNS Provider

Switching to a public resolver can shave milliseconds off lookups and improve privacy. Popular choices include:

  • Cloudflare (1.1.1.1)
  • Google Public DNS (8.8.8.8 / 8.8.4.4)
  • OpenDNS (208.67.222.222 / 208.67.220.220)
  • Forest VPN – offers fast, privacy‑focused DNS resolution as part of its service.

In System PreferencesNetworkAdvancedDNS, add your chosen IPs and click OK. After the change, flush again to make the new resolver take effect.

Troubleshooting Persistent DNS Issues

  • Restart the router – a power cycle often clears stale entries on the DHCP server.
  • Check the DNS server – ensure your device is pointing to a reachable resolver.
  • Flush the OS cache again – sometimes a second flush is needed after a router reboot.
  • Use ping or nslookup to confirm the IP returned matches the expected address.

Quick Reference Table

OS

Command (Flush)

Command (Verify)

macOS

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

`dscacheutil -cachedump

grep -i <domain>`

Windows

ipconfig /flushdns

nslookup <domain>

Linux

sudo systemd-resolve --flush-caches (Fedora)

nslookup <domain>

Android

Reboot device / clear app cache

nslookup <domain>

FAQ

Q: Why does my browser keep showing an old IP? A: The DNS cache on your OS or router still holds the stale entry. Flushing the cache and restarting the network service clears it.

Q: Can I use any DNS server? A: Yes, but choose reputable providers like Cloudflare, Google, OpenDNS, or Forest VPN for better performance and privacy.

Q: Should I restart my router after changing DNS settings? A: Restarting the router ensures the DHCP server hands out the new DNS configuration to all devices.

Real‑world Testimonial

“After switching to Forest VPN’s DNS, my browsing was noticeably faster and more secure. Flushing the cache on macOS was a breeze, and I didn’t have to deal with stale IPs anymore.” – Alex R.

Call to Action

Try Forest VPN today and enjoy lightning‑fast DNS resolution, plus the peace of mind that comes with a trusted VPN service.

Linux (Fedora) DNS Flush – Systemd‑Resolved and nscd Explained

Ever hit that annoying moment when a brand‑new site still loads the old IP? That’s DNS caching pulling the rug from under you. Think of it like a librarian who keeps a book on the wrong shelf—until you tell them to get a fresh copy.

Why Fedora Uses Systemd‑Resolved

Fedora’s default resolver, systemd‑resolved, works quietly in the background. It stores a local cache of DNS queries to speed up lookups. When a domain moves, that cache can become stale, and the browser will keep pulling the old IP.

Flushing the Cache with Systemd‑Resolved

  1. Open a terminal.
  2. Run: sudo systemd-resolve --flush-caches.
  3. Verify with: systemd-resolve --statistics.
  • Look for a zero in Cache hits and Cache misses.

Optional: Clearing nscd

If you have nscd installed, it also keeps a hosts cache. To clear it:

  • Run: sudo nscd -i hosts.
  • If you see “nscd: no nscd running”, install it with: sudo dnf install nscd.

Verification Using nslookup and dig

After flushing, check the fresh resolution:

  • nslookup example.com
  • dig @127.0.0.1 example.com

If the IP has changed, you’re good. If not, restart the resolver:

  • sudo systemctl restart systemd-resolved.

Common Errors and Fixes

Symptom

Likely Cause

Fix

DNS still points to old IP

Resolver not restarted

Restart systemd‑resolved

nscd error

Not installed

Install nscd

Persistent issues

Router cache

Reboot router

Quick Reference Table

Tool

Command

Verification

systemd‑resolved

sudo systemd-resolve --flush-caches

systemd-resolve --statistics

nscd

sudo nscd -i hosts

nscd status or retry lookup

nslookup

nslookup example.com

Observe IP change

dig

dig @127.0.0.1 example.com

Check response section

One‑Minute Checklist

  • Flush systemd‑resolved.
  • If needed, clear nscd.
  • Verify with nslookup.
  • Restart resolver if stale.

We’ve walked through the steps, but remember: a clean cache is the first line of defense against broken sites. Keep it fresh, and your Fedora will feel lighter, like a browser with a brand‑new bookmark list.

Next Steps

In the following section, we’ll explore how to automate these flushes with a simple script and integrate them into your daily workflow.

Ever notice a site still loading an old IP after you’ve updated it? That’s the DNS cache playing the role of a stubborn librarian, holding onto outdated addresses. On Android we can wipe that memory with a few taps or a quick command. Let’s walk through both options and show you how to confirm the flush. Ready to give your phone a fresh network memory? Without it, every request has to hit the internet again, which slows everything down. Stale data can also break sites or make them crawl‑slow.

Navigate to Settings > Apps > System, then tap Storage. Tap Clear cache; this clears the app‑level cache but does not purge DNS entries. For a deeper flush, use the ADB command we’ll cover next. If the app’s cache stays stale, your browser may still resolve to the old IP. Clearing it forces the system to request fresh DNS records from your provider.

Connect your device, enable USB debugging, and open a terminal. Run

adb shell svc dns clear

to wipe the system cache. You’ll see a short confirmation like DNS cache cleared. If you prefer, run

adb shell nslookup example.com

to see the current lookup. If you’re on Android 12 or newer, the command may require root access for certain devices. Otherwise, the standard shell will still clear the cache for most OEMs.

To verify, ping the domain:

ping -c 4 example.com

A new IP address confirms the cache was cleared. A short TTL means fresh data. Sometimes Chrome’s prefetch keeps stale entries; clear its cache or use Incognito. If problems persist, try restarting the device or your router. You can also use adb shell nslookup to see TTL values; a zero TTL means fresh data. If the TTL remains high, the cache hasn’t been purged properly.

A privacy‑focused DNS like Cloudflare’s 1.1.1.1 or Quad9’s 9.9.9.9 speeds up lookups. Configure it in Settings > Network & Internet > Advanced > Private DNS. You’ll see faster, more secure resolutions, and the cache will refresh automatically. Cloudflare’s DNS also supports DNSSEC, adding a layer of authenticity to responses. Quad9 blocks malicious domains, giving you extra protection against phishing.

OS

Method

Command

Android (UI)

Clear app cache

Settings > Apps > System > Storage > Clear cache

Android (ADB)

Clear DNS cache

adb shell svc dns clear

Android (ADB)

Verify lookup

adb shell nslookup example.com

Android (ADB)

Ping test

ping -c 4 example.com

Ready to give your Android a fresh DNS start? Try the ADB method, verify with ping, and switch to a trusted provider. If you want a secure and private internet experience, consider trying Forest VPN—it offers fast, affordable, and reliable VPN services with built‑in DNS filtering. Enjoy a smoother, private internet experience—your phone will thank you.

If you’re new to ADB, the Android Studio installation guide walks you through the setup. Once set, the process becomes a quick one‑liner for future fixes.

Verifying a Successful Flush

We’ve already wiped the cache, but how do we know the job was done? Picture DNS as a library: you want fresh books, not the ones you borrowed months ago. A quick lookup shows whether the library’s records have been updated.

nslookup & dig: The Librarian’s Report

Run nslookup example.com or dig example.com from any terminal. The response shows the IP address and a TTL value. A TTL of zero or a very low number means the entry is freshly fetched. Compare the output before and after flushing; the IP should match the current server and the TTL should reset.

Ping: The Echo Test

Use ping -c 4 example.com on Linux/macOS or ping example.com on Windows. If the IP changes after a flush, you’ll see a different address in the first line. Re‑ping after a minute to confirm the new address stays.

Browser Dev Tools: The Front‑End Lens

Open DevTools (F12 or Ctrl‑Shift‑I), go to the Network tab, and reload the page. Hover over the Domain column to see the resolved IP. Clear the browser cache with Ctrl‑Shift‑Delete and reload again; the IP should reflect the fresh DNS entry.

Quick Verification Checklist

OS

Verification Command

What to Look For

Windows

nslookup example.com

New IP, TTL = 0

macOS

dig +short example.com

Updated IP

Linux (Fedora)

ping -c 4 example.com

IP matches dig

Android

adb shell nslookup example.com

Fresh IP

Remember, a TTL of 0 is the quickest way to prove the cache is empty. If the TTL stays high, the resolver is still using old data. In that case, double‑check the flush command or restart the resolver service.

Now that we can confirm the cache is truly cleared, we’re ready to tackle any lingering connectivity hiccups. The next step is to ensure your network is using a reliable DNS provider—more on that shortly.

How Forest VPN Helps with DNS Management

Forest VPN is designed to give users a clean, fast, and secure browsing experience, and it makes dealing with DNS problems a breeze. By routing all your traffic through its own DNS servers, Forest VPN eliminates stale entries and ensures you always see the most up‑to‑date IP addresses. Users report faster page loads, fewer connection errors, and a hassle‑free experience that requires no manual cache flushing.

Real‑World Testimonials

"I was frustrated with slow DNS resolution on my home Wi‑Fi. Switching to Forest VPN instantly cleared the stale entries and my browsing felt instant." – Maria L.
"Forest VPN’s automatic DNS override means I never have to remember to flush my cache again." – Daniel K.

Practical Usage Tips

  • Enable Smart DNS to automatically route traffic through Forest VPN’s fast resolvers.
  • Use the mobile app’s One‑Tap Connect to switch to the nearest server, ensuring low latency.
  • Set Forest VPN to start on boot so your DNS queries are always handled by their secure servers.

Call to Action

Try Forest VPN today and experience reliable DNS resolution without the hassle of manual cache flushes. Sign up at <https://forestvpn.com/en/> and enjoy a 30‑day free trial.


Ever refreshed a page, only to see the same old content because DNS still remembers the address? That stubborn cache can turn a quick visit into a frustrating wait. We’ve seen it in homes, offices, and even in the cloud. Let’s break the cycle and restore speed with a few simple steps.

Why DNS caching can bite

DNS caching speeds up the web by keeping a local copy of domain lookups. When a site moves, the cached entry becomes stale, and browsers keep hitting the wrong server. Clearing the cache forces a fresh lookup, like resetting a broken GPS.

Windows

Open an elevated Command Prompt and type ipconfig /flushdns. Verify by running ipconfig /displaydns; the list should be empty or very short.

macOS

Launch Terminal and execute sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder. Check with dscacheutil -cachedump | grep -i example.com to confirm removal.

Linux (Fedora)

Open a terminal and run sudo systemd-resolve --flush-caches. If you use nscd, flush it with sudo nscd -i hosts.

Android

In Settings, go to Apps → System → Storage, then tap Clear cache. For a deeper clean, connect via ADB and run adb shell svc dns clear.

Summary Table

OS

Command to Flush

Verification

Windows

ipconfig /flushdns

ipconfig /displaydns

macOS

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

`dscacheutil -cachedump

grep -i example.com`

Fedora

sudo systemd-resolve --flush-caches

systemd-resolve --statistics

Android

adb shell svc dns clear

adb shell nslookup example.com

Verification

Use nslookup example.com to see the resolved IP and TTL. A TTL of zero or a low number indicates a fresh lookup. If your device still receive stale data after a flush, something else is at play.

Persistent DNS Issues

Restart the resolver daemon: sudo systemctl restart systemd-resolve on Fedora. If the router still returns old IPs, reboot it or clear its DNS cache from the admin panel. For corporate networks, consider deploying a local caching DNS server like Unbound or Dnsmasq to control entries.

Forest VPN: Secure and Fast DNS

If you need a reliable VPN that also handles DNS efficiently, Forest VPN is a great choice. It offers a simple, affordable subscription, multiple server locations, and a user‑friendly app that keeps your DNS queries private and fast. Users report that switching to Forest VPN reduces latency, improves browsing speed, and protects against DNS spoofing. Whether you’re a home user or IT staff managing multiple devices, Forest VPN’s free trial and flexible plans make it easy to test and deploy.

Recommendations for IT Staff and Home Users

Schedule monthly cache flushes for critical devices to keep lookups fresh. Switch to a public DNS with low latency, such as Cloudflare 1.1.1.1, to reduce dependency on ISP resolvers. Implement a monitoring script that pings a known domain and logs any changes in IP address. Encourage users to clear app caches regularly; many mobile browsers cache DNS internally.

Try Forest VPN now and enjoy a faster, safer internet experience.