How to flush DNS on Windows, Mac, and Linux in simple steps

avatar
|

The Domain Name System (DNS) acts as the internet’s address book, translating website names into IP addresses so that you can access them quickly and efficiently. To speed things up, your device stores DNS data locally in a cache.

However, this cache can sometimes become outdated or corrupted, causing issues such as slow connections, website errors, or security vulnerabilities. Fortunately, flushing DNS clears the cache, helping resolve these problems. This guide will show you how to flush DNS on Windows, Mac, and Linux, step by step.

Understanding DNS and DNS cache

To delve into flushing the DNS cache, it’s first crucial to clarify what DNS is and its significance.

DNS translates easy-to-remember domain names, such as mywebsite.net into numerical IP addresses that computers use to locate websites. This ensures your device quickly finds the correct server whenever you browse online. To save time, this data is stored temporarily in a local cache.

While helpful, the DNS cache can cause problems if it becomes outdated or contains incorrect information. For instance, you might experience issues like:

  • Websites not loading correctly.
  • Pages showing outdated content.
  • Connection errors when the DNS cache conflicts with updated server data.

Therefore, flushing DNS cache is a quick fix for resolving connectivity problems and ensuring smoother browsing.

When should you flush DNS?

Flushing DNS isn’t something you need to do every day, but there are specific scenarios where it becomes necessary:

  • Websites fail to load: If you encounter errors or cannot access certain sites despite having an active internet connection, the DNS cache may be at fault.
  • DNS server changes: Switching to a new DNS provider, such as Google DNS or Cloudflare, requires clearing the old cache to ensure proper connectivity.
  • Malware or security concerns: DNS cache poisoning or hijacking can redirect you to malicious websites. Flushing DNS removes potentially harmful entries.

In such situations, flushing your DNS cache helps restore smooth and secure browsing, ensuring your device connects to the right destinations.

How to flush DNS on Windows

Windows offers multiple methods to flush DNS, primarily through Command Prompt and PowerShell. Let’s dive into the steps:

Using Command Prompt

  1. Press Win + R to open the Run dialog box.
  2. Type cmd and press Enter to open Command Prompt.
  3. In the Command Prompt window, type the following command:
    ipconfig /flushdns
  4. Press Enter. You’ll see a confirmation message: “Successfully flushed the DNS Resolver Cache.”

Using PowerShell

  1. Press Win + X and select Windows PowerShell.
  2. Enter the same command:
    Clear-DnsClientCache
  3. Press Enter to flush the DNS cache.

These methods work on Windows 10 and 11, but earlier versions like Windows 7 or 8 follow a similar process.

How to flush DNS on macOS

On macOS, you can flush DNS using Terminal. The commands vary slightly depending on your macOS version. Follow these steps:

  1. Open Terminal by pressing Command + Space, typing “Terminal,” and hitting Enter.
  2. Enter the appropriate command based on your macOS version:
    • For macOS Ventura or later:
      sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
    • For older versions:
      sudo killall -HUP mDNSResponder
  3. Press Enter and enter your admin password when prompted.
  4. There won’t be a confirmation message, but the DNS cache will be cleared.

How to flush DNS on Linux

Linux systems often use tools like systemd-resolved or dnsmasq for DNS caching. The exact steps depend on your distribution and setup.

For systems using systemd-resolved:

  1. Open a terminal window.
  2. Type the following command:
    sudo systemd-resolve --flush-caches
  3. Press Enter to clear the DNS cache.

For systems using dnsmasq:

  1. Restart the dnsmasq service with the command:
    sudo systemctl restart dnsmasq
  2. Press Enter to apply the changes.

If you’re unsure which DNS caching service your Linux distribution uses, consult the documentation or use a universal approach by restarting the network service:

sudo service network-manager restart 

Verifying the DNS cache is flushed

After flushing the DNS cache, you might want to confirm the operation. Here’s how:

  • Windows: Use Command Prompt and type:
    ipconfig /displaydns

    An empty list indicates the cache is cleared.

  • macOS: There isn’t a built-in verification command, but you can test by accessing a previously visited website and checking for changes.
  • Linux: For systemd-resolved, use:
    sudo systemd-resolve --statistics

    The output will show reset statistics.

Additional tips for managing DNS

Managing DNS effectively goes beyond just flushing the cache. Consider these tips:

  1. Switch to a reliable DNS provider: Services like Google DNS (8.8.8.8, 8.8.4.4) or Cloudflare (1.1.1.1) often provide faster and more secure browsing.
  2. Regular maintenance: Flushing DNS periodically can help avoid caching issues and improve connection reliability.
  3. Use tools for monitoring: Applications like DNS Benchmark or What’s My DNS can help identify DNS-related problems and optimize your settings.

By adopting these practices, you can enhance your DNS performance, improve security, and ensure a smoother online experience.

Conclusion

Flushing DNS is a straightforward yet powerful way to resolve network issues, improve browsing performance, and enhance security. Whether you’re on Windows, macOS, or Linux, following the steps in this guide ensures you can clear your DNS cache quickly and effectively. Bookmark this article as a handy reference, and don’t hesitate to share it with others who might benefit from these tips!

Read more

blog thumbnail

IPFoxy review: Are its pure rotating residential proxies worth it?

Shared and blacklisted IPs frequently disrupt multi-account setups, prompting IPFoxy to enter the market with a bold promise: pure, non-reused proxies engineered for maximum stealth. Backed by a global network of over 90 million IPs across 200+ countries, this provider positions itself as a cost-effective, enterprise-grade choice for both digital marketers and web scrapers. But does IPFoxy actually deliver clean connections under real-world workloads, or is its "pure IP" promise just another marketing gimmick? In this review, IPFighter will break down IPFoxy’s features, pricing, and put its rotating residential proxies to the test to see if this provider is worth your investment.  Show more
Valerie Thorne avatar
Valerie Thorne
blog thumbnail

CatProxies review: What do its five proxy types offer?

Success in proxy-dependent tasks relies on balancing IP authority, network speed, and pricing rather than raw pool size alone. CatProxies addresses these varying requirements by offering residential, mobile, ISP, and datacenter proxy solutions with flexible session controls. In this CatProxies review, IPFighter examines the provider's proxy offerings, key features, pricing, and setup workflow. We also perform hands-on tests across its Standard and Premium Residential networks to evaluate IP quality, speed, and location accuracy in real-world scenarios.  Show more
Valerie Thorne avatar
Valerie Thorne
blog thumbnail

Hidemyacc review 2026: Features, pricing and real fingerprint test results

Running several accounts on Facebook, Amazon, TikTok or ad platforms from one computer is easy to start and hard to keep alive. Platforms link accounts through browser fingerprints, cookies and network signals, and one linked account can drag the rest down with it. A multi-accounting browser solves this by giving every account its own isolated browser profile. Hidemyacc is one of the tools built for this job. In this review, we look at what Hidemyacc offers, what it costs, and how a fresh profile actually performs when we run it through IPFighter’s fingerprint and leak tests.  Show more
Valerie Thorne avatar
Valerie Thorne
blog thumbnail

Whitecloakproxy review: What to know before you buy

High-trust mobile connections are crucial for bypassing strict security filters, making dedicated 5G lines a game-changer for digital operations. White Cloak Proxy specializes in this approach, offering dedicated 5G mobile proxies with unlimited bandwidth, automated provisioning, and flexible plans starting at $8 per day. But does its performance and IP quality match the needs of demanding proxy users? In this WhiteCloakProxy review, IPFighter examines the provider's proxy offering, key features, pricing, setup process, and performance testing. We also look at its refund policy and compare White Cloak Proxy with alternative providers to help you decide whether its dedicated mobile network suits your requirements.  Show more
Valerie Thorne avatar
Valerie Thorne
blog thumbnail

Geonix review: What makes its proxy services stand out?

With a diverse proxy lineup covering residential, mobile, ISP, and datacenter proxies, backed by more than 10 years of experience, does Geonix actually deliver the quality it claims? With more than 15 million IPs across 200+ countries and locations, the provider offers a wide range of proxy options and features for different use cases. In this review, IPFighter takes a closer look at Geonix’s proxy types, key features, pricing, setup process, and real-world performance to help you determine whether Geonix is the right fit for your needs.  Show more
Valerie Thorne avatar
Valerie Thorne
blog thumbnail

Floppydata review: A closer look at its proxy network

Floppydata brings residential, mobile, and datacenter proxies together under one service, but how consistently do its IPs perform across different locations? Its pricing model and range of proxy options may simplify proxy management, while real-world IP quality, connection speed, and location accuracy still need to be evaluated separately. In this Floppydata review, IPFighter examines the provider’s proxy types, pricing, key features, setup process, and performance. We also test 15 randomly selected IPs across five target countries to assess their IP quality, connection speed, blacklist status, proxy detection, and location consistency.  Show more
Valerie Thorne avatar
Valerie Thorne