How to change DNS on Mac
Complete guide with multiple methods and troubleshooting for changing DNS on Mac.
7-10 min read
Expert Verified
Last Updated: August 2025
Quick Answer
Changing the DNS on a Mac can significantly improve your internet speed and security. This can be accomplished through System Preferences or via the Terminal for advanced users.
Beginner/Intermediate⏱ 7-10 min read
Prerequisites & Requirements
Before changing your DNS settings on a Mac, ensure you have the following:
- •A Mac running macOS 10.12 (Sierra) or later.
- •Administrator access to the Mac to change network settings.
- •Backup of important data in case of network issues.
- •Knowledge of the DNS servers you wish to use (e.g., Google DNS: 8.8.8.8 and 8.8.4.4, Cloudflare DNS: 1.1.1.1 and 1.0.0.1).
Method 1: Changing DNS via System Preferences
This is the most straightforward method for most users and is suitable for general DNS changes.
- •Step 1: Click on the Apple menu () in the top-left corner of your screen and select 'System Preferences'.
- •Step 2: Click on 'Network'. You will see a list of network connections on the left side.
- •Step 3: Select your active network connection (e.g., Wi-Fi or Ethernet) and click on the 'Advanced...' button in the bottom right corner.
- •Step 4: Navigate to the 'DNS' tab. Here, you will see a list of DNS servers.
- •Step 5: To add a new DNS server, click the '+' button below the DNS Servers list and enter the new DNS address. To remove an existing DNS server, select it and click the '-' button.
- •Step 6: After making your changes, click 'OK' and then 'Apply' to save the changes.
- •Step 7: To verify it worked, open a web browser and check your internet connection. You can also use the command 'nslookup google.com' in Terminal to see which DNS server is being used.
- •Step 8: If it doesn't work, double-check the DNS addresses entered for typos and ensure your network connection is active.
For macOS Monterey (12) and later
The steps remain largely the same, but the interface may have slight visual changes.
- •In System Preferences, the layout may be more streamlined, but the 'Network' and 'Advanced...' options are still present.
- •Ensure you are selecting the correct network interface (Wi-Fi or Ethernet) as the icons may differ slightly.
For macOS Big Sur (11) and earlier
The process is similar, but the visual elements may differ slightly.
- •The 'System Preferences' window may have a different layout, but the 'Network' and 'Advanced...' buttons are still accessible.
- •Ensure you are familiar with the layout of your specific macOS version.
Method 2: Changing DNS via Terminal
For advanced users, changing DNS settings via Terminal can be quicker and more efficient.
- •Step 1: Open Terminal by navigating to Applications > Utilities > Terminal.
- •Step 2: To view your current DNS settings, type 'scutil --dns' and press Enter.
- •Step 3: To change the DNS settings, use the following command: 'sudo networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4'. Replace 'Wi-Fi' with 'Ethernet' if you're using a wired connection.
- •Step 4: Enter your administrator password when prompted.
- •Step 5: To verify the changes, run 'scutil --dns' again to see the updated DNS servers.
- •Step 6: If you encounter issues, ensure you have administrative rights and that the command syntax is correct.
Troubleshooting Common Issues
If you encounter problems after changing your DNS settings, consider the following solutions:
- •Error: 'DNS server not responding' - Solution: Check your DNS addresses for typos and ensure they are valid.
- •Issue: 'Cannot connect to the internet' - Fix: Revert to your previous DNS settings by selecting 'Automatically' in the DNS tab.
- •Problem: Slow browsing speeds after changing DNS - Workaround: Try a different DNS server or revert to your ISP's default DNS.
Advanced Tips & Shortcuts
For power users looking to optimize their DNS settings further:
- •Keyboard shortcut: Command + Space - Opens Spotlight Search, allowing you to quickly find and open System Preferences or Terminal.
- •Command line: 'dig google.com' - Use this command in Terminal to test DNS resolution speed and check which DNS server is being used.
- •Hidden feature: Use 'networksetup -listallnetworkservices' in Terminal to view all network services and their settings.
Common Mistakes to Avoid
Avoid these common pitfalls:
Expert Tips
For optimal performance, consider using a combination of public DNS servers for redundancy.