Dns

How To Use Ipconfig /Flushdns To Flush Dns On Windows, Mac, Linux & Browsers

Flushing your DNS cache is one of the quickest ways to fix common internet issues like outdated website data, connection errors, or incorrect IP resolution. The Domain Name System stores temporary records to speed up browsing, but these cached entries can sometimes become stale or corrupted. In this guide, you’ll learn how to use ipconfig /flushdns on Windows and clear DNS cache on Mac, Linux, and popular browsers to ensure your system fetches fresh and accurate data.

Why and when to flush your DNScache

The Domain Name System translates a hostname (like example.com) to an IP address so your device can reach the correct server. To speed lookups, your operating system and browsers keep a DNS cache containing recent resource data with a TTL (time to live). While this cache accelerates browsing, it can become stale or corrupted. A timely flush DNS action clears those entries so new queries reach your configured DNS server and fetch fresh records.

Common symptoms that a DNS cache flush fixes include:

  • You see an outdated website version after a migration or content delivery network (CDN) change.
  • A domain moves to a new IPv4 or IPv6 address but your system still uses the old IP address.
  • Intermittent resolution failures after switching Wi‑Fi, VPNs, or network settings.
  • Malicious redirection or DNS poisoning indicators (DNS cache poisoning can send you to rogue hosts).
  • Sign-in loops or service endpoints changing (for example, after Microsoft Office 365 or identity provider updates).
Two Layers of DNS Caching

When does a DNS flush help?

  • Immediately after DNS changes on authoritative servers or registrar updates.
  • After changing the local DNS server (e.g., moving from ISP DNS to a privacy resolver).
  • When troubleshooting a broken network connection alongside a release IP address and renew IP address cycle.
  • After toggling DoH/DoT or proxy settings that can confuse resolution paths.
  • When browser DNS cache behaviors (e.g., Chrome DNS cache) conflict with the OS cache.

Many reputable sources—university IT pages (such as the UCSD ITS Service Desk or the University of Mount Olive), vendor knowledge bases (e.g., Pearson), and training guides (freeCodeCamp)—routinely recommend a DNS flush command as a first step in DNS troubleshooting to resolve DNS issues safely and quickly.

Windows: Use ipconfig /flushdns

The canonical Windows DNS flush command is ipconfig /flushdns. You can run it in the Windows command prompt or in PowerShell, and it applies system‑wide.

Run the DNSflush command and related fixes

  1. Open an elevated shell
  • Press Start, type Command Prompt, right-click it, and choose run as administrator. You can also open Windows PowerShell (Admin). Using the Windows command prompt with elevated rights ensures system services can be controlled.
  1. Execute the core commands
  • Flush the resolver cache:
    • ipconfig /flushdns
  • Verify cache entries (optional):
    • ipconfig /displaydns
  • Renew your IP configuration (optional but often helpful):
    • ipconfig /release
    • ipconfig /renew Running ipconfig /release will release IP address leases, and ipconfig /renew will renew IP address details from DHCP, complementing a DNS cache clear if your network settings changed.
  1. Re-register and reset networking (if needed)
  • Re-register dynamic DNS for domain-joined machines:
    • ipconfig /registerdns
  • Reset the Winsock catalog (useful after malware cleanups or socket errors):
    • netsh winsock reset
  • Optionally reset the TCP/IP stack:
    • netsh int ip reset After netsh winsock reset (and a TCP/IP reset), restart computer to ensure the Winsock and network service components reload cleanly.
Windows Network Commands Table

Notes:

  • All of these commands can be issued in the Windows command prompt or in an elevated Command Prompt window.
  • ipconfig /flushdns is safe to run repeatedly. It simply forces new lookups by clearing the DNS cache.

Verify results and fix common errors

  • Confirm the flush:
    • ipconfig /displaydns should now show few or no entries until you start browsing again.
  • “Could not flush the DNS Resolver Cache: Function failed…” usually indicates:
    • The DNS Client service is stopped. Start it via Services (services.msc) or: net start dnscache.
    • You didn’t run the Windows command prompt as an administrator. Re-open and run as administrator.
  • Name still resolves to the old IP address?
    • Use ipconfig /release followed by ipconfig /renew to release IP address settings from DHCP, then ipconfig /registerdns. Repeat ipconfig /flushdns to ensure freshness.
    • Check hosts file overrides: C:*Windows*\System32\drivers\etc\hosts.
    • Confirm your DNS server settings in Windows Settings > Network & Internet. Corporate images may enforce DNS through policy.
  • Socket or stack problems:
    • netsh winsock reset followed by a restart computer can clear lingering Winsock catalog corruption.
  • Mixed IPv4/IPv6 issues:
    • Validate with nslookup both A (IPv4) and AAAA (IPv6) records to see which path is stale.

Guidance like this appears across Microsoft support, university IT help (e.g., UCSD ITS Service Desk), and enterprise runbooks because these steps resolve a large share of practical DNS issues on Windows.

macOS and Linux: Flush DNSvia Terminal

Apple and Linux distributions maintain DNS caches differently. Use Terminal (Mac) or your Linux shell to flush DNS quickly.

macOS (Apple)

On modern macOS versions, the system resolver relies on mDNSResponder and the dscacheutil interface.

  • Open Terminal (Mac).
  • Run:
    • sudo dscacheutil -flushcache
    • sudo killall -HUP mDNSResponder These commands clear the DNS cache and signal mDNSResponder to reload. There’s no success message; test resolution afterward.

Older versions (OS X Yosemite era) used discoveryutil:

  • sudo discoveryutil mdnsflushcache

Tips:

  • Safari primarily uses the system resolver; there’s no dedicated Safari DNS cache page. If web apps still show stale lookups, flush DNS again and consider clearing browser caches.
  • You typically do not need to restart computer, but doing so can help after significant network service changes.
Mac OS Terminal Commands

Linux (systemd-resolved, nscd, dnsmasq, NetworkManager)

Linux varies by distribution and enabled services:

  • systemd-resolved:
    • sudo resolvectl flush-caches
    • or: sudo systemd-resolve –flush-caches
    • Check stats: resolvectl statistics
  • nscd (Name Service Cache Daemon):
    • sudo service nscd restart
    • or: sudo systemctl restart nscd
  • dnsmasq:
    • sudo systemctl restart dnsmasq
  • NetworkManager caching plugin:
    • sudo nmcli general reload
    • or restart the network service depending on your distro.

After a flush DNS action on Linux, retest with dig or nslookup to confirm fresh answers and updated TTL values. If your resolver path includes DoH/DoT or corporate proxies, ensure their caches aren’t serving stale resource data.

Linux DNS Flush Variations

Browsers and post-flush verification

Some browsers maintain their own caches independent of the OS. Clearing the browser DNS cache can be the final step to fully clear DNS cache across layers, especially with DNS over Hypertext Transfer Protocol (HTTP) enabled.

Google Chromeand Microsoft Edge

  • Open Google Chrome (or Chromium-based Edge).
  • Visit chrome://net-internals/#dns (Edge: edge://net-internals/#dns).
  • Click Clear host cache to purge the Chrome DNS cache.
  • Then visit chrome://net-internals/#sockets and “Flush socket pools” to reset active connections that might pin old endpoints.
  • If you use Secure DNS (DoH) in Chrome, temporarily disable it under Settings > Privacy and Security to avoid conflicting resolution paths during DNS troubleshooting. Re-enable it after validation.

These steps ensure the browser DNS cache doesn’t resurrect stale entries even after you run ipconfig /flushdns at the OS level.

Firefox and Safari

  • Firefox:
    • Go to about:networking#dns and click “Clear DNS Cache.”
    • If testing with DoH, toggle network.trr.mode or disable DoH temporarily in Settings > General > Network Settings to compare behavior against the system resolver.
  • Safari (Mac):
    • Safari relies on macOS’s resolver. Use sudo dscacheutil -flushcache plus sudo killall -HUP mDNSResponder. You may also clear general browsing caches via Develop > Empty Caches, but DNS resolution itself clears via macOS commands.

If a site still loads an outdated website version, test in a Private/Incognito window to isolate caching and cookies.

Flushing DNS Across All Platforms

Verify and troubleshoot after flushing

  • Query authoritative answers:
    • nslookup example.com or dig example.com on multiple networks (home vs. mobile hotspot). Check the TTL (time to live) to understand cache expiration timing.
  • Compare DNS server paths:
    • Ensure the configured DNS server in system preferences (Mac) or Windows network settings is the one you intend (enterprise DNS, ISP DNS, or a public resolver). Domain join and AD policies can override local choices.
  • Consider upstream caches:
    • Your router and ISP may cache responses. Power-cycle your router if needed, or test via a different network connection.
  • VPN, proxies, and DoH:
    • A virtual private network (VPN) client, enterprise proxy, or DoH policy can route DNS over different tunnels. Disable them briefly to isolate the problem.
  • Hosts file overrides:
    • macOS/Linux: /etc/hosts
    • Windows: C:*Windows*\System32\drivers\etc\hosts Remove unintended static mappings that force a wrong IP address.
  • Application and service endpoints:
    • Cloud platforms like Microsoft Office 365 or single sign-on (SSO) providers may change hostnames. After a flush DNS sequence, sign out/in and test fresh sessions.
  • When to expand scope:
    • If corruption persists, on Windows run netsh winsock reset to rebuild the Winsock catalog, then restart computer. Follow with ipconfig /flushdns, ipconfig /release, ipconfig /renew, and ipconfig /registerdns in an elevated Windows command prompt or Command Prompt window to fully reset name resolution and renew IP address information.
  • Documentation and support:
    • Enterprise teams and campus IT (e.g., UCSD ITS Service Desk or University of Mount Olive IT) often publish resolver settings and known issues. Vendor help centers (including Pearson) and developer tutorials (freeCodeCamp) provide step-by-step walk-throughs for the DNS flush command on different platforms.

By clearing every layer—the OS DNS cache, the browser DNS cache, and, if necessary, resetting Winsock/TCP/IP—you create a clean slate for the Domain Name System to resolve your domain queries accurately and securely, minimizing exposure to DNS poisoning and ensuring cache expiration works as designed—while email authentication protocols like DMARC, SPF, and DKIM further protect your domain from spoofing and phishing attacks.

Similar Posts