HomeIT Troubleshooting & FixesHow to Flush DNS cache on your Mac

    How to Flush DNS cache on your Mac

    Date:

    Find out what DNS cache is and learn how to clear your Mac’s DNS cache to fix slow browsing and connection errors.

    While using Macs for everyday tasks doesn’t require a deep understanding of their inner workings, having some knowledge about fundamental macOS components, like DNS cache, can help us quickly resolve common issues such as website connection error.

    One problem that many users struggle to fix is flushing the DNS cache in macOS. In this article, we’ll explore what DNS cache is, why it’s important to flush it, and the most effective methods for doing so.

    What is DNS Cache & Why Should You Clear It?

    DNS (Domain Name System) is like the internet’s phonebook. It is a system for translating website or domain names (e.g., example.com) into a format that computers and routers can understand (e.g., 98.184.234.24). When you visit a website, your Mac stores its IP address in the DNS cache to load it faster next time. However, if a website changes its IP address (i.e., it could be because they have dynamic IPs, moved to a different registrar, or switched hosting companies) or your cache gets corrupted, you might face issues like:

    • ✅ Websites not loading properly
    • ✅ Slow browsing speeds
    • ✅ Security risks due to outdated cache

    Flushing your Mac’s DNS cache is a simple fix that refreshes these records, resolving many connectivity problems instantly.

    How to clear DNS cache manually

    Using terminal command user can quickly clear DNS records on macOS. However, before clearing the DNS cache, check your macOS version first. The steps to flush the DNS cache vary slightly based on your macOS version.

    How to Check Your macOS Version

    How to Check Your macOS Version
    1. Click the Apple menu () in the top-left corner.
    2. Select About This Mac.
    3. Note your macOS version (e.g., macOS Ventura, Monterey, Big Sur, Catalina, etc.).

    How to flush DNS cache on macOS Big Sur, Monterey, Ventura, Sonoma, and Sequoia, and newer

    The way you flush DNS on Mac is by entering a specific command into the Terminal, which changes depending on the operating system you have installed. For macOS Big Sur and later, use the following Terminal command:

    Flush DNS cache on macOS Big Sur, Monterey,  Ventura, Sonoma, and Sequoia, and newer
    • Open Terminal (Go to Applications > Utilities > Terminal).
    • Type the following command and press Return:
    sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
    • Enter your admin password when prompted.
    • Press Return again.
    • That’s it! Your DNS cache is now cleared.

    How to Flush DNS Cache on macOS Catalina and Earlier

    If you are using an older version of macOS, you can flush the DNS cache on your Mac using Terminal. However, the commands you need will vary. To flush the DNS cache on macOS Catalina down to El Capitan:

    Flush DNS Cache on macOS Catalina and Earlier
    • Open Terminal and type:
    sudo killall -HUP mDNSResponder
    • Press Return and enter your admin password when asked.
    • Your DNS cache is now refreshed!

    For even older versions use the follwing terminal commands.

    • macOS Yosemite:
    sudo discoveryutil udnsflushcaches
    • macOS Mavericks & earlier:
    sudo killall -HUP mDNSResponder

    Troubleshooting: What If Flushing DNS Cache Doesn’t Work?

    If websites are still not loading correctly after clearing the DNS cache, try these steps:

    • Restart your Mac – A simple reboot can help clear any lingering issues.
    • Change your DNS settings – Use a faster public DNS like Google DNS (8.8.8.8, 8.8.4.4) or Cloudflare DNS (1.1.1.1).
    • Flush browser cache – If a website is still not working, clearing your browser cache may help.
    • Reset Network Settings – Go to System Settings > Network > Advanced and reset your network settings.

    FAQ for DNS cache on Mac

    Is it safe to flush DNS cache on Mac?

    Yes! Flushing your DNS cache is completely safe and won’t harm your Mac. It simply removes outdated DNS records so your system can fetch fresh data.

    How do I know if my DNS cache was cleared?

    After flushing the cache, try revisiting a website that wasn’t loading before. If it loads correctly now, the flush was successful. Otherwise, try rebooting your Mac.

    Where is my DNS cache stored?

    DNS cache records are stored deep in your Mac’s system files. That’s why you need to use Terminal or network utility tools to clear them.

    khaledshariar
    khaledshariar
    A dedicated IT professional with expertise in technical support, hardware troubleshooting, and network engineering. Skilled at resolving complex issues, managing Linux servers, and optimizing IT operations.

    LEAVE A REPLY

    Please enter your comment!
    Please enter your name here

    Related articles:

    Latest courses:

    Strategic Vision: Mastering Long-Term Planning for Business Success

    Introduction: Professional growth is a continuous journey of acquiring new...

    Leadership Excellence: Unlocking Your Leadership Potential for Business Mastery

    Introduction: Professional growth is a continuous journey of acquiring new...

    Marketing Mastery: Strategies for Effective Customer Engagement

    Introduction: Professional growth is a continuous journey of acquiring new...

    Financial Management: Mastering Numbers for Profitability and Sustainable Growth

    Introduction: Professional growth is a continuous journey of acquiring new...

    Innovation and Adaptability: Thriving in a Rapidly Changing Business Landscape

    Introduction: Professional growth is a continuous journey of acquiring new...

    More to read...