How to flush DNS cache on Mac
Complete guide with multiple methods and troubleshooting for flushing DNS cache on Mac.
7-10 min read
Expert Verified
Last Updated: August 2025
Quick Answer
Flushing the DNS cache on a Mac can resolve issues related to outdated or corrupt DNS records. This process clears the cached entries, allowing your system to retrieve fresh DNS information from the server.
Medium⏱ 7-10 min read
Prerequisites & Requirements
Before flushing the DNS cache on your Mac, ensure you have the following:
- •macOS version: Ensure your Mac is running macOS 10.10 (Yosemite) or later, as the command varies by version.
- •Administrator access: You need admin privileges to execute the flush command.
- •Terminal application: Familiarity with using the Terminal app is helpful.
- •Backup important data: Always back up critical data before making system changes.
Method 1: Using Terminal Command
This method is the most common and effective way to flush the DNS cache on a Mac. Use this method if you are comfortable with the command line.
- •Step 1: Open the Terminal application. You can find it in Applications > Utilities > Terminal or by searching 'Terminal' using Spotlight (Cmd + Space).
- •Step 2: Type the command based on your macOS version and press Enter:
- • - For macOS Big Sur (11) and later: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
- • - For macOS Mojave (10.14) and Catalina (10.15): sudo killall -HUP mDNSResponder
- • - For macOS Sierra (10.12) and High Sierra (10.13): sudo killall -HUP mDNSResponder
- • - For macOS El Capitan (10.11): sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
- •Step 3: You will be prompted to enter your administrator password. Type it in (note that it won’t show on the screen) and press Enter.
- •Step 4: To verify it worked, you can check your DNS settings or try accessing a website that previously had issues.
- •Step 5: If it doesn't work, ensure you entered the command correctly and that you have admin privileges.
For macOS Ventura (13) and later
Use the same command as for Big Sur and Monterey.
- •Command: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
For macOS Monterey (12)
Use the same command as for Big Sur.
- •Command: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Method 2: Using System Preferences
This method is useful for users who prefer a graphical interface over the command line.
- •Step 1: Open System Preferences by clicking the Apple logo in the top left corner and selecting 'System Preferences'.
- •Step 2: Click on 'Network'.
- •Step 3: Select your active network connection (Wi-Fi or Ethernet) from the left sidebar.
- •Step 4: Click on 'Advanced'.
- •Step 5: Navigate to the 'DNS' tab and remove any existing DNS servers by selecting them and clicking the '-' button.
- •Step 6: Click 'OK' and then 'Apply'. This effectively clears the DNS cache.
- •Step 7: To verify, try accessing a website that had issues before.
Troubleshooting Common Issues
If you encounter issues while flushing the DNS cache, consider the following solutions:
- •Error: 'command not found' - Solution: Ensure you are typing the command correctly in the Terminal.
- •Issue: No internet connection after flushing - Fix: Restart your router or check your network settings.
- •Problem: DNS cache not clearing - Workaround: Restart your Mac and try flushing the DNS cache again.
Advanced Tips & Shortcuts
For power users, here are some tips to enhance your experience:
- •Keyboard shortcut: Cmd + Space - Opens Spotlight for quick access to applications like Terminal.
- •Command line: dscacheutil -q host - This command checks the current DNS cache entries.
- •Hidden feature: Use 'ping' command in Terminal to test DNS resolution for a specific domain.
Common Mistakes to Avoid
Avoid these common pitfalls:
Expert Tips
Regularly flushing your DNS cache can help maintain optimal network performance and prevent connectivity issues.