How to Flush Your DNS Cache on Windows and Mac – The Server Room

0


A local DNS cache stores website address information temporarily, but outdated entries can cause connection errors or direct visitors to an old server. Flushing the cache refreshes this information, with instructions provided for Windows and macOS.

Browser caches, routers, and public DNS resolvers may also retain outdated records. Additional troubleshooting includes restarting browsers or network devices, checking the resolved IP address, trying another DNS resolver, and allowing time for TTL-based DNS propagation.

Your computer keeps a local DNS cache to help websites load faster. Instead of looking up a website’s IP address every time you visit it, your computer temporarily stores the DNS information it previously received.

Normally this works well. However, cached DNS can cause problems after a website changes servers, changes IP addresses, moves to a new hosting provider, or updates its DNS records.

You may see the old website, get a connection error, or reach the old server even though the DNS change has already been completed.

Flushing your local DNS cache forces your computer to request fresh DNS information.

Flush DNS on Windows 10 or Windows 11

  • Open the Start menu.
  • Type Command Prompt.
  • Open Command Prompt. If needed, choose Run as administrator.
  • Enter:
  • ipconfig /flushdns

    You should see a message confirming that the DNS Resolver Cache was successfully flushed.

    You can also clear the DNS cache from PowerShell with:

    Clear-DnsClientCache

    Flush DNS on macOS

    Open Terminal and run:

    sudo dscacheutil -flushcache
    sudo killall -HUP mDNSResponder

    Enter your Mac password when prompted. Terminal may not display a confirmation message afterward. That is normal.

    The old discoveryutil command found in many older tutorials is no longer appropriate for current versions of macOS.

    Your Browser May Also Cache DNS

    Sometimes clearing the operating system’s DNS cache is not enough because your browser may maintain its own DNS or connection cache.

    First try completely closing and reopening your browser.

    If Chrome or another Chromium-based browser still appears to be using outdated DNS information, you can also try:

    chrome://net-internals/#dns

    Select Clear host cache.

    You can then visit:

    chrome://net-internals/#sockets

    and select Flush socket pools.

    Browser troubleshooting pages and options can change between versions, so restarting the browser is usually the simplest first step.

    Other Things to Try

    If flushing DNS does not solve the problem:

    • Try the website in a private or incognito window.
    • Try another browser.
    • Restart your computer.
    • Restart your router or modem.
    • Try the website from your phone using cellular data instead of Wi-Fi.
    • Test both example.com and www.example.com, since they can use different DNS records.
    • Temporarily try a different DNS resolver, such as Cloudflare 1.1.1.1 or Google Public DNS 8.8.8.8.

    Check Which IP Address You Are Getting

    Before assuming DNS propagation is the problem, check which IP address your computer is actually receiving.

    On Windows:

    nslookup example.com

    On macOS or Linux:

    dig example.com

    Replace example.com with your domain.

    If the command returns your new server’s IP address, public DNS may already be correct and the problem could instead be browser cache, a proxy, CDN cache, local networking, or the website configuration itself.

    How Long Do DNS Changes Take?

    There is no fixed DNS propagation time.

    DNS records include a TTL, or Time To Live, which tells DNS resolvers how long they may cache a record before checking again. Because different computers, routers, browsers, and DNS resolvers may have cached the previous record at different times, some visitors can see the new server before others.

    Many DNS changes become visible within minutes or a few hours. In some situations, cached records can remain until their previous TTL expires, which can make a change appear to take 24 hours or longer.

    Flushing your computer’s DNS cache can remove the local copy, but it cannot force every DNS resolver on the Internet to discard its cached records.

    If you recently moved a website to Web Host Pro and are still seeing the old server, flushing your local DNS cache is one of the fastest troubleshooting steps to try.



    Source link

    You might also like