Back to blog

How to Purge DNS for Faster Internet and Improved Connectivity

Learn how purging DNS can enhance your internet speed and connectivity. Improve your browsing experience today—read the article for step-by-step guidance.

Purge DNS: How to Safely Clear Your DNS Cache (and Why It Matters)

If your computer refuses to load a website you know is online, or you keep landing on an old version of a page after a hosting migration, your local DNS cache is likely the culprit. Purging or flushing the DNS cache means clearing the temporary database of website IP addresses stored on your device so that fresh lookups can happen. This article walks you through exactly how to do it on every major platform, explains the security and privacy reasons behind it, and shows how pairing a DNS purge with an encrypted resolver service like Dnsium gives you the best of both worlds.

Quick answer: how to purge DNS cache right now

If you already know why you need to flush your DNS cache and just want the command, here it is. To clear DNS cache on Windows, use ipconfig /flushdns. On macOS, the following command does the job: sudo killall -HUP mDNSResponder. Linux users have distribution-specific options listed below.

  • Windows (Command Prompt):
ipconfig /flushdns
  • Windows (PowerShell as admin):
Clear-DnsClientCache
  • macOS (10.10.4+):
sudo killall -HUP mDNSResponder
  • Ubuntu with systemd-resolved:
sudo systemd-resolve --flush-caches
  • Generic Linux using nscd:
sudo /etc/init.d/nscd restart

After running the appropriate command, close and reopen your browser. If connectivity issues persist, try restarting your network adapter or toggling Wi-Fi off and on.

If you use a private DNS resolver service like Dnsium, you do not need to change any Dnsium configuration when you purge your local DNS cache. The flush only affects data stored on your device, and your next query will simply travel through Dnsium's encrypted pipeline as usual.

What is DNS cache?

The Domain Name System is often called the "phone book of the internet." When you type a domain name into your web browser's address bar, DNS translates that human-readable name into the IP addresses that servers actually use to communicate. The DNS resolver cache stores a temporary database of recent website visits and their corresponding IP addresses, saving your device from performing a full recursive lookup every single time you load web pages.

  • A DNS cache stores resource records (A, AAAA, CNAME, MX, and others) retrieved from upstream DNS servers. DNS caching stores IP addresses for faster access, which dramatically reduces latency and cuts down on network traffic.

  • Cached DNS records expire based on their time to live (TTL). TTL values typically range from 60 seconds to several hours. For example, many DNS providers default to around 300 seconds (5 minutes) for dynamic records, while others use 3,600 seconds (one hour) for standard A records.

  • The local operating system DNS cache is what this article mainly covers when referring to "purge DNS." But your browser also maintains its own separate cache (Chrome, Firefox, and Edge each keep one), and the recursive resolver you connect to (such as Dnsium) has yet another layer of cached data.

Why you should purge DNS cache

Flushing or purging the DNS cache is a safe, low-risk troubleshooting step that can fix a surprising number of everyday browsing problems. It takes only a few seconds to run and has no permanent side effects on your system.

  • Outdated records after a site migration. When a website moves to new IP addresses or a different host, your device may still serve the old cached entry. Flushing DNS cache helps resolve outdated IP address issues by forcing your computer to request the current record from a recursive resolver. Flushing DNS ensures local cache records are up to date.

  • DNS record changes not reflected. If DNS records were recently changed (for example, on 2026-06-18 after a hosting switch), but your device still uses outdated entries, a cache purge is the fastest fix on the client side.

  • DNS cache poisoning and spoofing. Attackers can inject false IP addresses into vulnerable caches, redirecting traffic to phishing pages. Clearing the local cache forces fresh authoritative lookups via a secure resolver, reducing the window of exposure. More on this in the security section below.

  • Privacy and tracking. The local DNS cache keeps a short-term history of every domain name your device has resolved. Clearing it reduces what could be recovered from your machine by someone with physical or remote access.

  • General troubleshooting. Frequent DNS_PROBE_FINISHED_NXDOMAIN errors, timeouts, or "server IP address could not be found" messages are common triggers. Flushing DNS cache can resolve access issues to websites that are otherwise perfectly online. It can also resolve HTML 404 error codes caused by stale cache entries pointing to retired server paths. Flushing DNS improves performance by speeding up connections once the cache rebuilds with current data.

Using an encrypted, privacy-focused DNS resolver service like Dnsium protects queries in transit via DoH and DoT, while purging local DNS cache cleans data stored on the endpoint. They complement each other.

How DNS record changes and propagation affect your cache

When a domain's A, AAAA, or MX records are changed at the authoritative DNS provider, the update does not reach every user instantly. DNS propagation can take 24 to 48 hours to fully ripple across the global DNS infrastructure, because caches at every layer hold onto old data until the TTL expires.

  • Multiple cache layers hold old records. Your ISP's resolver cache, any public resolver cache, your local OS cache, and your browser cache may each independently serve stale information until each copy's TTL runs out.

  • Example scenario. A site moves from IP 203.0.113.10 to 198.51.100.77 at 2026-06-17 12:00 UTC. If the previous A record had a TTL of 3,600 seconds (one hour), some users will still resolve the old IP for up to an hour. Users whose resolvers cached the record minutes before the change face the longest wait.

  • Purging speeds things up locally. Clearing your local DNS cache and browser cache helps your device pick up the updated IP faster, even while global propagation continues elsewhere.

  • Limitations. Purging your local cache cannot shorten TTLs at remote resolvers. It only guarantees that your own device stops relying on its own stale information and sends a fresh query upstream.

When using a private recursive resolver service like Dnsium, the resolver is tuned to respect TTLs faithfully while also protecting users with filtering and encryption, independent of any local purge you perform.

Security risks: DNS cache poisoning and why flushing helps

Outdated or compromised DNS cache entries can silently expose users to phishing and malware, often without any visible warning until it is too late.

  • What DNS cache poisoning is. An attacker injects forged DNS responses so that the cache stores an incorrect IP for a legitimate domain (for example, bank.example resolving to an attacker-controlled server). DNS cache poisoning can redirect users to fake websites that look identical to the real thing.

  • Real-world impact. Users think they are on a genuine site while actually sending passwords, cookies, or credit card data to a malicious server. Research has shown that roughly 35.5% of open DNS servers acting as both resolvers and forwarders are vulnerable to advanced poisoning techniques, making this more than a theoretical risk.

  • How purging helps. Clearing DNS cache can prevent DNS cache poisoning attacks by removing poisoned entries and forcing new lookups from a trusted, validating resolver. Flushing DNS helps prevent DNS cache poisoning, and it is especially useful after noticing suspicious redirects or certificate warnings.

  • Combine purging with other precautions. Always check browser padlock icons and TLS certificates after a flush. Use encrypted DNS (DNS-over-HTTPS or DNS-over-TLS) provided by a security service such as Dnsium to prevent tampering in transit.

  • Filtering adds another layer. Privacy-focused resolvers with malware and tracker filtering (like Dnsium) reduce the chance of reaching known malicious domains even if a local cache was previously compromised, because the resolver itself blocks resolution of flagged domains before the response ever reaches your device.

How to purge DNS cache on different systems

The exact DNS purge steps depend on your operating system, and each subsection below gives specific commands using built-in tools like Command Prompt or Terminal.

  • All commands should be run with administrator or root privileges where required. Most operations complete instantly.

  • This section covers:

    • Windows 11 / Windows 10 using Command Prompt and PowerShell.

    • macOS (recent versions).

    • Ubuntu and other popular Linux distributions.

    • Browser-level DNS cache (Chrome, Firefox, Edge) including internal pages like chrome://net-internals/#dns or their modern equivalents.

  • Flushing local DNS cache does not affect external DNS services, including those provided by Dnsium. It simply makes the device request fresh records from whichever resolver is configured.

Windows: purge DNS cache with Command Prompt

Windows maintains a DNS Resolver Cache managed by the DNS Client service. You can clear it in seconds with the ipconfig /flushdns command.

  • Press Win + R, type cmd, and press Ctrl + Shift + Enter to open command prompt as administrator.

  • In the Command Prompt window, type ipconfig /displaydns and press enter to optionally view current DNS cache entries before flushing.

  • To purge DNS, type the following command and press enter:

ipconfig /flushdns
  • Windows should display the message "Successfully flushed the DNS Resolver Cache." as confirmation.

  • If you still have issues after the flush, you can also clear your browser cache and restart the network adapter by running ipconfig /release followed by ipconfig /renew.

Windows imposes a maximum cache retention of 24 hours even if a record's TTL is longer, so entries are never more than a day old. But when troubleshooting, waiting a full day is rarely an option, which is why the manual ipconfig flushdns command exists.

Windows: purge DNS cache with PowerShell

On modern Windows systems, PowerShell offers an alternative command for clearing the DNS client cache that many administrators prefer for scripting and remote management.

  • Right-click the Start button and select "Windows PowerShell (Admin)" or "Terminal (Admin)" on Windows 11.

  • Run Get-DnsClientCache to view current cached records if needed.

  • Run the following command to purge DNS cache:

Clear-DnsClientCache
  • No verbose success message may appear. The command completes silently unless there is an error, which is normal behavior.

  • This method is often preferred by power users and administrators managing scripts, remote systems, or batch operations across multiple machines.

macOS: purge DNS cache using Terminal

macOS uses mDNSResponder for DNS resolution, and the cache can be cleared via Terminal. macOS requires sudo killall -HUP mDNSResponder to clear DNS cache on versions 10.10.4 and later.

  • Open Finder → Applications → Utilities → Terminal. Alternatively, use spotlight search by pressing Cmd + Space and typing "Terminal."

  • For macOS 10.10.4 and later (including Monterey, Ventura, Sonoma, and Sequoia), run the following command in the terminal window:

sudo killall -HUP mDNSResponder
  • Optionally append && echo "DNS cache flushed" so you see a confirmation string displayed in the terminal.

  • The system usually does not display official output beyond the password prompt. Simply retry accessing the problematic domain afterward to confirm the fix.

  • An administrator password is required for the sudo command. No characters appear while typing the password-this is expected mac terminal behavior.

Some older macOS versions (10.10.0–10.10.3) used sudo discoveryutil mdnsflushcache instead. If you are running an Apple machine with an older release, check the exact command for your version before proceeding.

Linux: purge DNS cache on Ubuntu and other distributions

Linux does not always cache DNS at the operating system layer by default, but many modern distributions use caching services like systemd-resolved, nscd, or dnsmasq. Ubuntu users can clear DNS cache with a specific command depending on which service is active.

  • Ubuntu 20.04+ and other systemd-based distros:
sudo systemd-resolve --flush-caches

Optional verification: run sudo systemd-resolve --statistics to see cache counters reset to zero.

  • Systems using nscd:
sudo /etc/init.d/nscd restart

or

sudo service nscd restart
  • Systems using dnsmasq:
sudo systemctl restart dnsmasq

If no system caching daemon is running (common on minimal server installs), the resolver stub passes queries directly upstream. In that case, your browser cache is the only local layer to clear.

Browser DNS cache: Chrome, Firefox, Edge

Even after you flush the OS-level cache, your browser may still serve stale DNS data from its own internal cache. In stubborn cases, you need to clear both.

  • Chrome (and Chromium-based browsers like Edge, Brave, Opera):

    • Type chrome://net-internals/#dns in the address bar and click the clear host cache button.

    • Optionally also clear sockets via chrome://net-internals/#sockets if connection reuse is causing problems.

  • Firefox:

    • In the address bar, enter about:networking#dns and use the "Clear DNS Cache" button if available.

    • Alternatively, select "Clear Recent History" including "Site Settings," which may trigger a DNS cache reset.

  • Microsoft Edge:

    • Similar approach to chrome using edge://net-internals/#dns. The interface mirrors Chromium's internals page.
  • Mobile devices: Android does not have a user-facing system to clear the DNS cache directly. However, toggling Airplane Mode on and off can clear the DNS cache on mobile devices, as it forces the network stack to reinitialize.

Combine a browser DNS purge with clearing the browser HTTP cache (images and files) only if you are comfortable losing some locally saved site data.

How often should you purge DNS cache?

There is usually no need for a daily or weekly schedule. The DNS cache works well most of the time, and entries rebuild automatically on the next lookup.

  • It is completely safe to clear DNS cache as often as needed. Cached entries are rebuilt automatically with each new page load.

  • Common triggers for a manual DNS purge include:

    • After making changes to DNS records (A, AAAA, CNAME, MX) for your domain.

    • After switching DNS resolvers (for example, from your ISP's default DNS to a private encrypted service like Dnsium).

    • After moving a website to new hosting or a CDN.

    • After seeing repeated DNS errors, suspicious redirects, or unexpected certificate warnings.

  • Most users only need to flush DNS a few times per year, typically when troubleshooting connectivity or after site migrations. While the full process of flushing DNS takes approximately 15 minutes to complete (including cache rebuild and propagation to your resolver), the command itself finishes in under a second.

  • For privacy-focused users, occasional purging of local DNS cache is one extra layer of protection in addition to using an encrypted resolver service like Dnsium that minimizes logging and blocks trackers by design.

Using a private encrypted DNS resolver service with DNS purging

DNS cache purging is about the local device. Choosing the right DNS resolver service controls how queries are handled on the network between your computer and the wider internet. These are two separate but complementary actions.

  • What Dnsium offers:

    • Encrypted DNS via DNS-over-HTTPS (DoH) and DNS-over-TLS (DoT) to protect against eavesdropping and injection. When you select DNS settings on your device or router, pointing them to Dnsium ensures every query leaves your machine encrypted.

    • Built-in ad and tracker blocking at the DNS level, reducing exposure to online tracking across all applications and devices without requiring additional software.

    • Minimal logging and a privacy-first policy suited to security-conscious users who want to protect their browsing information.

  • How purging interacts with Dnsium:

    • After flushing your local cache, your device will immediately fetch fresh records from Dnsium's recursive resolvers.

    • This ensures you get up-to-date records plus Dnsium's filtering and security checks on every query.

  • Recommended troubleshooting workflow:

    1. Confirm your device is configured to use Dnsium as its DNS resolver service (via router, OS network settings, or a DoH/DoT profile).

    2. Purge DNS cache using the appropriate system command from the steps above.

    3. Clear browser DNS cache if the issue persists.

    4. Test access to multiple domains—both regular sites and any previously problematic website.

  • Dnsium is a paid service with a 30-day money-back guarantee, making it suitable for users who want long-term encrypted, ad-blocking DNS without free-tier limitations or email signup walls.

Summary: when "purge DNS" should be your first step

Purging DNS cache is a low-risk, high-value action whenever you face mysterious website failures, stale content after DNS changes, or potential signs of DNS manipulation. It costs nothing, takes seconds, and has zero permanent side effects on your system or your data.

  • Forces fresh DNS lookups instead of relying on possibly outdated local data, preventing connection errors caused by old or incorrect records.

  • Helps protect against some forms of DNS cache poisoning by wiping potentially compromised entries and pulling verified data from a trusted resolver.

  • Clears traces of recently resolved domains on the local machine, providing a small but meaningful privacy benefit.

  • For everyday Windows users, the single most important command to save is ipconfig /flushdns in an elevated command prompt. Mac users should remember sudo killall -HUP mDNSResponder.

  • For stronger overall DNS privacy and security, combine occasional DNS cache purges with a private, encrypted DNS resolver service like Dnsium that blocks ads, trackers, and known malicious domains before they ever reach your device.