HostVitals by Zrina
← Back to Status Checker
Troubleshooting Guide

How to Flush Your Local DNS Cache on Windows, macOS, Linux & Mobile

When you type a domain name like perplexity.ai or github.com into your browser, your operating system does not query global DNS servers every single time. Instead, it saves recently resolved IP addresses in a temporary local database known as the DNS Resolver Cache.

While caching makes everyday web browsing significantly faster, it creates a common problem: if a website migrates to a new server IP, switches CDN providers, or recovers from a temporary DNS misconfiguration, your computer may continue trying to connect to the old, dead IP address until the cached record's Time-To-Live (TTL) expires.

When might flushing DNS help? If the HostVitals edge probe (or a public gateway fallback) receives a response but your browser cannot load the site, a local DNS or network issue is one possible cause. HostVitals cannot identify the cause on its own; compare the result with another network or resolver before changing settings.

1. Flush DNS Cache on Windows 10 & Windows 11

On Windows, the DNS Client service manages cached domain records. You can clear it in seconds using Command Prompt, PowerShell, or Windows Terminal:

  1. Press Win + R, type cmd, and press Enter.
  2. Type the following command and press Enter:
ipconfig /flushdns

You will immediately see the confirmation message: "Successfully flushed the DNS Resolver Cache."

2. Flush DNS Cache on macOS (Sonoma, Sequoia, Ventura & Monterey)

On modern macOS releases, DNS caching is handled by both a directory service cache and the mDNSResponder daemon. Open the Terminal app (via Spotlight Cmd + Space) and run:

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Enter your Mac login password when prompted (characters will not appear as you type) and press Return.

3. Flush DNS Cache on Linux (Ubuntu, Debian, Fedora)

Most modern Linux distributions use systemd-resolved to manage local DNS caching. Open your terminal and run:

sudo resolvectl flush-caches

If your distribution uses dnsmasq or nscd instead, restart the respective daemon using sudo systemctl restart dnsmasq or sudo systemctl restart nscd.

4. Clear Internal Browser DNS & Socket Cache (Chrome, Edge, Brave)

Chromium-based browsers maintain their own internal DNS cache separate from your operating system. Even after running ipconfig /flushdns, your browser may hold onto stale active sockets:

  1. Open a new tab and paste the following internal address into the URL bar:
chrome://net-internals/#dns
  1. Click the "Clear host cache" button.
  2. Next, navigate to chrome://net-internals/#sockets in the left menu and click "Flush socket pools".

5. Clear DNS Cache on iOS (iPhone / iPad) and Android

Mobile operating systems do not provide a terminal command for unrooted devices, but you can force an immediate network stack and DNS flush using either of these methods: