When you visit a website, your computer stores its DNS information in cache to speed up future visits. However, if the website’s DNS records change, your computer may still try to use outdated information, causing errors. Flushing the DNS cache clears these records and forces your system to retrieve fresh data.

How to Flush DNS on Windows

Follow these simple steps to clear your DNS cache on a Windows computer:

1. Open Command Prompt

  • Press Windows + R on your keyboard.
  • Type cmd and press Enter to open the Command Prompt.

2. Run the Flush DNS Command

  • In the Command Prompt window, type:
ipconfig /flushdns
  • Press Enter.
  • You should see a confirmation message: “Successfully flushed the DNS Resolver Cache.”
  • Flush DNS in Windows Command Prompt

    How to Flush DNS on macOS

    For Mac users, the process varies slightly depending on the macOS version:

    macOS Ventura and Later

    sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

    macOS Monterey, Big Sur, and Catalina

    sudo killall -HUP mDNSResponder

    macOS Mojave and Older Versions

    sudo dscacheutil -flushcache

    After running the command, enter your Mac’s administrator password if prompted.

    How to Flush DNS on Linux

    For most Linux distributions using systemd-resolved, use the following command:

    sudo systemctl restart systemd-resolved

    On older Linux systems with nscd installed, use:

    sudo service nscd restart

    Why Flush Your DNS Cache?

    • Fix Website Loading Issues: If a website’s DNS has changed, clearing the cache forces your computer to fetch the new IP address.
    • Improve Security: Prevents phishing attacks that exploit outdated DNS records.
    • Resolve Network Problems: Helps fix slow browsing, incorrect website loading, and connection errors.

    Need Assistance?

    If you’re facing persistent DNS issues, UnderHost’s expert support team is available 24/7. Contact us via @CustomerPanel for troubleshooting assistance.