How to Change DNS on Mac: Complete Step-by-Step Guide for Better Performance
Changing your DNS settings on Mac can significantly improve your internet speed, enhance security, and protect your privacy. While most users rely on the default DNS provided by their internet service provider (ISP), switching to faster, more secure DNS servers can optimize your browsing experience and provide additional protection against malicious websites.
In this comprehensive guide, we'll walk you through how to change DNS on Mac, explain the benefits, recommend the best DNS providers, and help you troubleshoot common issues across different macOS versions.
Why Change DNS Settings on Your Mac?
Before diving into the configuration steps, it's important to understand the benefits of changing your DNS settings:
Performance Benefits:
- Faster website loading with optimized DNS resolution
- Reduced latency for better browsing and streaming
- Improved app performance for services that rely on DNS lookups
- Better gaming experience with lower ping times
Security and Privacy Benefits:
- Malware and phishing protection from secure DNS providers
- Enhanced privacy with no-logging DNS services
- Content filtering options for safer browsing
- DNS over HTTPS (DoH) and DNS over TLS (DoT) support for encrypted queries
Access Benefits:
- Bypass geographic restrictions on certain content
- Access blocked websites in restrictive networks
- Improve reliability when your ISP's DNS is down
- Better parental controls with family-safe DNS options
How to Change DNS on Mac: Step-by-Step Instructions
There are several methods to change DNS settings on Mac, depending on your macOS version and preferences. We'll cover the most common approaches:
Method 1: Change DNS Using System Settings (macOS Ventura 13.0+ and Sonoma)
For the latest macOS versions, Apple has moved DNS settings to the new System Settings app:
Step 1: Open System Settings
- Click the Apple menu in the top-left corner
- Select System Settings
- Click Network in the sidebar
Step 2: Select Your Network Connection
- Choose your active network connection (Wi-Fi or Ethernet)
- Click Details next to your connection name
Step 3: Configure DNS Settings
- Click the DNS tab
- Click the + button to add DNS servers
- Enter your preferred DNS server addresses (see recommended providers below)
- Click OK to save the changes
Method 2: Change DNS Using System Preferences (macOS Big Sur, Monterey, and earlier)
For older macOS versions, DNS settings are located in System Preferences:
Step 1: Open Network Preferences
- Click the Apple menu and select System Preferences
- Click Network
Step 2: Select Network Interface
- Select your network connection (Wi-Fi or Ethernet) from the left sidebar
- Click Advanced in the bottom-right corner
Step 3: Configure DNS Servers
- Click the DNS tab
- Click the + button under DNS Servers
- Enter your preferred primary DNS server address
- Click + again and add a secondary DNS server for backup
- Click OK and then Apply to save changes
Method 3: Change DNS Using Terminal (Advanced Users)
For power users who prefer command-line configuration:
Step 1: Identify Network Interface
networksetup -listallnetworkservices
Step 2: Set DNS Servers
# For Wi-Fi
sudo networksetup -setdnsservers "Wi-Fi" 1.1.1.1 1.0.0.1
# For Ethernet
sudo networksetup -setdnsservers "Ethernet" 1.1.1.1 1.0.0.1
Step 3: Verify Changes
networksetup -getdnsservers "Wi-Fi"
Method 4: Change DNS for Specific Wi-Fi Networks
To set custom DNS for individual Wi-Fi networks:
Step 1: Connect to Wi-Fi Network
- Connect to the Wi-Fi network you want to configure
- Open System Settings (or System Preferences)
- Navigate to Network
Step 2: Configure Network-Specific DNS
- Click Details next to your Wi-Fi connection
- Go to the DNS tab
- Add your preferred DNS servers
- These settings will only apply to this specific network
Best DNS Providers for Mac
Here are the top DNS providers recommended for Mac users:
1. Cloudflare DNS (1.1.1.1)
- Primary: 1.1.1.1
- Secondary: 1.0.0.1
- Best for: Speed and privacy
- Features: Fastest global performance, no logging, free, supports DoH/DoT
2. Google DNS (8.8.8.8)
- Primary: 8.8.8.8
- Secondary: 8.8.4.4
- Best for: Reliability and compatibility
- Features: Excellent uptime, global network, free
3. Quad9 DNS (9.9.9.9)
- Primary: 9.9.9.9
- Secondary: 149.112.112.112
- Best for: Security and malware protection
- Features: Blocks malicious domains, privacy-focused, free
4. OpenDNS (208.67.222.222)
- Primary: 208.67.222.222
- Secondary: 208.67.220.220
- Best for: Content filtering and family safety
- Features: Customizable filtering, phishing protection, parental controls
5. AdGuard DNS (94.140.14.14)
- Primary: 94.140.14.14
- Secondary: 94.140.15.15
- Best for: Ad blocking and privacy
- Features: Blocks ads and trackers, no logging, multiple filtering options
Testing Your New DNS Settings
After changing your DNS settings, it's crucial to verify they're working correctly:
Quick Verification Steps:
- Restart your network connection by turning Wi-Fi off and on
- Check basic connectivity by browsing to major websites
- Test DNS resolution speed using our DNS Speed Test
- Verify DNS servers by checking what DNS you're actually using
- Test specific domains with our DNS Lookup tool
Performance Testing:
Want to see how your new DNS settings compare? Use our comprehensive DNS performance testing tool to:
- Compare multiple DNS providers
- Test from different global regions
- Measure actual resolution times
- Get personalized recommendations
Command Line Testing:
For advanced users, verify your DNS changes using Terminal:
# Check current DNS servers
scutil --dns | grep nameserver
# Test DNS resolution
nslookup google.com
# Test with specific DNS server
nslookup google.com 1.1.1.1
Troubleshooting Common DNS Issues on Mac
Issue 1: Internet Not Working After DNS Change
Solution:
- Go back to Network settings
- Remove custom DNS servers by selecting them and clicking -
- Leave DNS servers blank to use automatic settings
- Try a different DNS provider with known working servers
Issue 2: Some Websites Won't Load
Possible causes:
- DNS server is blocking the domain
- DNS propagation delay
- Incorrect DNS server addresses
- Network-specific restrictions
Solution:
- Double-check your DNS server addresses for typos
- Try accessing the site after a few minutes
- Use a different DNS provider
- Test the specific domain to verify DNS resolution
- Flush your DNS cache using Terminal:
sudo dscacheutil -flushcache
Issue 3: Slow Internet After DNS Change
Solution:
- Test different DNS providers to find the fastest for your location
- Try servers geographically closer to you
- Check if your ISP throttles external DNS traffic
- Consider using your ISP's DNS as secondary backup
Issue 4: Can't Change DNS Settings
Solution:
- Make sure you have administrator privileges
- Try using Terminal method with sudo privileges
- Restart your Mac and try again
- Reset network settings if problems persist
- Contact your network administrator if on enterprise networks
Issue 5: DNS Changes Don't Take Effect
Solution:
- Flush DNS cache:
sudo dscacheutil -flushcache
- Restart your network interface
- Check if you have VPN software that might override DNS
- Verify changes using
scutil --dns
command
Advanced DNS Configuration Options
Using DNS Profiles for Different Networks
Create different DNS configurations for various scenarios:
- Home Network: Use fast DNS like Cloudflare (1.1.1.1)
- Work Network: Use secure DNS like Quad9 (9.9.9.9)
- Public Wi-Fi: Use privacy-focused DNS with filtering
- Gaming Setup: Use low-latency DNS optimized for your region
Setting Up DNS over HTTPS (DoH)
For enhanced privacy and security:
- Use DNS providers that support DoH (Cloudflare, Quad9)
- Configure DoH in supported browsers like Firefox or Chrome
- Consider using DNS client apps that support DoH system-wide
Custom DNS with Pi-hole
If you run your own DNS server:
- Use your Pi-hole server's IP address as primary DNS
- Set a reliable public DNS as secondary (backup)
- Ensure your Pi-hole is accessible from your Mac's network location
- Configure port forwarding if accessing remotely
Automating DNS Changes
For users who frequently switch networks:
- Use AppleScript to automate DNS switching
- Create shell scripts for quick DNS changes
- Use third-party apps like DNS Switcher for GUI control
- Set up location-based network configurations
DNS Security Best Practices for Mac
Enable DNS Filtering
- Use DNS providers that block malicious domains
- Consider family-safe DNS for households with children
- Enable phishing and malware protection
Use Encrypted DNS
- Choose providers supporting DNS over HTTPS (DoH)
- Enable DNS over TLS (DoT) when available
- Avoid unencrypted DNS on public networks
Monitor DNS Performance
- Regularly test DNS speed and reliability
- Use multiple DNS servers for redundancy
- Monitor for DNS hijacking or manipulation
Keep DNS Updated
- Review and update DNS settings periodically
- Stay informed about DNS provider changes
- Test new DNS services before fully switching
Conclusion: Optimize Your Mac's DNS for Better Performance
Changing DNS settings on your Mac is a simple yet powerful way to improve internet performance, enhance security, and protect your privacy. Whether you choose Cloudflare for speed, Quad9 for security, or OpenDNS for content filtering, the right DNS provider can significantly enhance your browsing experience.
Remember to test your new DNS settings thoroughly and choose providers that best match your specific needs. With the step-by-step instructions provided above, you can easily configure DNS on any Mac running macOS, from the latest versions to older systems.
👉 Ready to test your DNS performance? Run a comprehensive DNS speed test to compare providers and find the fastest option for your location.
Frequently Asked Questions
Q: Will changing DNS affect my internet speed?
A: Yes, switching to a faster DNS provider can improve website loading times and reduce latency. However, the improvement depends on your location and current DNS performance.
Q: Is it safe to change DNS settings on Mac?
A: Yes, changing DNS settings is completely safe and reversible. You can always switch back to automatic DNS settings if you experience issues.
Q: Can I use different DNS servers for different networks?
A: Yes, you can configure different DNS settings for each network connection (Wi-Fi, Ethernet) and even for specific Wi-Fi networks.
Q: Do I need to restart my Mac after changing DNS?
A: No, but you should restart your network connection or flush the DNS cache for changes to take effect immediately.
Q: How do I know if my DNS change worked?
A: You can verify your DNS settings using Terminal commands or by using online tools like DNSHog's DNS testing tools to check resolution.
Q: What's the difference between primary and secondary DNS?
A: Primary DNS is your main server for lookups. Secondary DNS acts as a backup when the primary server is unavailable or slow to respond.
Q: Can DNS changes help with streaming or gaming?
A: Yes, faster DNS resolution can improve initial connection times for streaming services and games, potentially reducing lag and buffering.