Introducing PostScale -- email API for transactional, inbound, and masked addresses. PostScale

    How to Flush Your DNS Cache

    Step-by-step instructions to flush your DNS cache on Windows, macOS, Linux, and Chrome. Learn why and when to clear your DNS cache.

    Flushing your DNS cache clears the locally stored DNS records on your device, forcing it to fetch fresh results from DNS servers. This is one of the first troubleshooting steps when a website isn't loading correctly or when you've recently made DNS changes.

    Why Flush Your DNS Cache

    Your operating system caches DNS lookups to speed up repeat visits. But this cache can become stale or incorrect:

    • After changing DNS records β€” you updated an A record or switched nameservers, but your browser still shows the old IP
    • After a DNS migration β€” you moved to a new DNS provider like DNScale and want to verify the change immediately
    • Website not loading β€” the cached record points to a server that's no longer responding
    • DNS poisoning concerns β€” a corrupted cache entry is returning the wrong IP address
    • Troubleshooting connectivity β€” ruling out stale DNS as the cause of network issues

    Flush DNS on Windows

    Windows 10 / 11

    Open Command Prompt or PowerShell as Administrator:

    ipconfig /flushdns

    You'll see: Successfully flushed the DNS Resolver Cache.

    To verify the cache is empty:

    ipconfig /displaydns

    Reset the DNS Client Service

    If flushing alone doesn't work:

    net stop dnscache
    net start dnscache

    Flush DNS on macOS

    The command varies by macOS version, but this works on macOS Monterey and later (including Ventura, Sonoma, and Sequoia):

    sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

    Enter your admin password when prompted. There's no confirmation message β€” the command completes silently.

    Older macOS Versions

    VersionCommand
    Big Sur / Monterey+sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
    Catalinasudo killall -HUP mDNSResponder
    Mojavesudo killall -HUP mDNSResponder
    High Sierrasudo killall -HUP mDNSResponder
    Sierrasudo killall -HUP mDNSResponder
    El Capitansudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

    Flush DNS on Linux

    Linux distributions vary in their DNS caching behavior. Many don't cache DNS by default, but if you use systemd-resolved, dnsmasq, or nscd, here's how to clear them:

    systemd-resolved (Ubuntu 18.04+, Fedora, Arch)

    sudo systemd-resolve --flush-caches

    Or on newer versions:

    sudo resolvectl flush-caches

    Verify with:

    resolvectl statistics

    dnsmasq

    sudo systemctl restart dnsmasq

    nscd (Name Service Cache Daemon)

    sudo systemctl restart nscd

    Or invalidate just the hosts cache:

    sudo nscd -i hosts

    Flush DNS in Chrome

    Chrome maintains its own internal DNS cache, separate from the OS cache. To clear it:

    1. Open Chrome and navigate to: chrome://net-internals/#dns
    2. Click Clear host cache
    3. Optionally, also go to chrome://net-internals/#sockets and click Flush socket pools

    Other Browsers

    • Firefox: No built-in DNS cache flush. Restart the browser, or set network.dnsCacheExpiration to 0 in about:config
    • Safari: Enable Develop menu (Preferences β†’ Advanced), then Develop β†’ Empty Caches
    • Edge: Same as Chrome β€” navigate to edge://net-internals/#dns

    When to Flush vs. When to Wait

    ScenarioAction
    Changed DNS records, want to verify nowFlush your cache
    Changed DNS records, can waitLet TTL expire naturally
    Website not loading, works for othersFlush your cache
    DNS migration in progressFlush after confirming changes with dig
    Regular browsingNo need to flush

    Verify DNS Changes Without Flushing

    Instead of flushing your cache, you can query a DNS server directly to check if your changes have propagated:

    # Query Google's public DNS
    dig example.com @8.8.8.8
     
    # Query Cloudflare's DNS
    dig example.com @1.1.1.1
     
    # Query your DNScale nameserver directly
    dig example.com @ns1.dnscale.eu

    This bypasses your local cache entirely and shows what DNS servers are currently returning.

    Understanding DNS Cache TTL

    DNS caching is controlled by the TTL (Time to Live) value set on each record. When you flush your cache, you're clearing entries before their TTL expires.

    Pro tip: If you plan to make DNS changes, lower the TTL to 300 seconds (5 minutes) a day before the change. After the change propagates, restore the original TTL. This minimizes the window where stale records are served. See DNS TTL Best Practices for more strategies.

    Conclusion

    Flushing your DNS cache is a quick, safe operation that forces your device to fetch fresh DNS data. Whether you're troubleshooting connectivity issues or verifying DNS changes after updating records in DNScale, it's an essential tool in every administrator's toolkit.