How to Change DNS Settings on macOS

Last updated: January 11, 2025
Table of Contents

Changing your DNS (Domain Name System) servers on macOS can improve your internet speed, enhance privacy, and bypass content restrictions. This comprehensive guide covers all macOS versions and includes TorGuard's secure DNS servers along with other privacy-focused options.

🔒 Why Change DNS?

  • Privacy: ISP DNS servers log your browsing activity
  • Speed: Faster DNS servers reduce website loading times
  • Security: Protection against DNS hijacking and phishing
  • Access: Bypass DNS-based content blocking

TorGuard DNS (VPN Users)

For optimal privacy when using TorGuard VPN, use our internal DNS servers:

DNS Type Primary DNS Secondary DNS Features
TorGuard Standard 10.8.0.1 10.10.0.1 No logs, Ad blocking available
TorGuard Secure 10.9.0.1 10.11.0.1 Enhanced security, Malware blocking
Note: TorGuard DNS servers only work when connected to TorGuard VPN. For non-VPN use, choose from the public DNS options below.

Public DNS Servers

Provider Primary DNS Secondary DNS Privacy Features
Cloudflare 1.1.1.1 1.0.0.1 No logs, DNSSEC, Fast
Quad9 9.9.9.9 149.112.112.112 Malware blocking, No logs
Google Public DNS 8.8.8.8 8.8.4.4 Fast, Reliable
OpenDNS 208.67.222.222 208.67.220.220 Content filtering options

For macOS Ventura (13.0) and Sonoma (14.0)

Apple redesigned System Settings in macOS Ventura. Here's the updated process:

  1. Click the Apple menuSystem Settings
  2. Click Network in the sidebar
  3. Click your active connection (Wi-Fi or Ethernet)
  4. Click Details...
  5. Click DNS in the sidebar
  6. Click the + button to add DNS servers
  7. Enter your preferred DNS servers
  8. Click OK to save

For macOS Big Sur (11.0) to Monterey (12.0)

Step 1: Open System Preferences

Click the Apple menu in the top-left corner and select System Preferences.

macOS System Preferences
Opening System Preferences from the Apple menu

Step 2: Access Network Settings

Click on the Network icon to access your network configuration.

Network icon in System Preferences
Select Network from System Preferences

Step 3: Select Your Network Interface

Select your active network connection from the left sidebar:

  • Wi-Fi: For wireless connections
  • Ethernet: For wired connections
  • Thunderbolt Bridge: For Thunderbolt networking

Click the Advanced... button in the bottom-right corner.

Network interface selection
Select your network interface and click Advanced

Step 4: Configure DNS Servers

Click the DNS tab to see your current DNS servers. To add new ones:

  1. Click the + button below the DNS Servers list
  2. Type the DNS server address (e.g., 1.1.1.1)
  3. Press Enter and repeat for additional servers
  4. Remove unwanted servers by selecting them and clicking -
  5. Drag servers to reorder priority (top = primary)
DNS configuration tab
Adding DNS servers in the DNS tab
Pro Tip: Grayed-out DNS entries are provided by DHCP. You can override them by adding your own entries, which will take priority.

Step 5: Apply Your Changes

  1. Click OK to close the Advanced settings
  2. Click Apply in the Network window
  3. Your new DNS settings are now active!

Enable DNS over HTTPS (DoH)

For enhanced privacy, enable DNS over HTTPS in macOS Big Sur and later:

  1. Download a DNS configuration profile from your provider:
  2. Double-click the downloaded profile
  3. Follow the installation prompts
  4. Go to System Preferences → Profiles to verify installation

Change DNS via Terminal

For advanced users, you can change DNS settings using Terminal:

View Current DNS Servers

networksetup -getdnsservers Wi-Fi

Set New 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

Reset to DHCP-provided DNS

sudo networksetup -setdnsservers Wi-Fi empty

Verify Your DNS Changes

After changing your DNS settings, verify they're working correctly:

Method 1: Using Terminal

# Check which DNS server is being used
nslookup google.com

# Or use dig
dig google.com

Method 2: Online DNS Leak Test

  1. Visit TorGuard DNS Leak Test
  2. Click "Standard Test" or "Extended Test"
  3. Verify the results show your chosen DNS servers

Troubleshooting Common Issues

DNS Changes Not Taking Effect

  • Flush DNS cache:
    sudo dscacheutil -flushcache
  • Restart network service:
    sudo killall -HUP mDNSResponder
  • Toggle Wi-Fi: Turn Wi-Fi off and back on
  • Reboot: Restart your Mac if changes persist

Slow DNS Resolution

  • Try different DNS servers closer to your location
  • Remove unnecessary DNS entries (keep only 2-3)
  • Ensure DNS servers are ordered by preference
  • Check for network interference or firewall rules

Websites Not Loading

  • Verify DNS server addresses are typed correctly
  • Test with a known working DNS (8.8.8.8)
  • Check if the issue is DNS-related:
    ping 8.8.8.8  # Should work if internet is connected
    nslookup google.com  # Should fail if DNS is broken

Configure DNS for Specific Applications

Some applications allow custom DNS settings:

Firefox

  1. Type about:config in the address bar
  2. Search for network.trr.mode
  3. Set value to 2 for DNS over HTTPS
  4. Set network.trr.uri to your DoH provider

Chrome

  1. Go to Settings → Privacy and security → Security
  2. Enable "Use secure DNS"
  3. Select your preferred provider

DNS with VPN Usage

⚠️ Important for VPN Users

When using TorGuard VPN, the app automatically configures secure DNS servers to prevent leaks. Manual DNS changes may interfere with this protection.

Best practices for VPN users:

  • Let TorGuard VPN manage DNS automatically
  • Enable "DNS Leak Protection" in TorGuard settings
  • Test for DNS leaks after connecting to VPN
  • Only use manual DNS when not connected to VPN

Advanced DNS Features on macOS

Split DNS Configuration

Configure different DNS servers for specific domains:

# Create a resolver file
sudo mkdir -p /etc/resolver
sudo echo "nameserver 10.8.0.1" > /etc/resolver/work.local

DNS Search Domains

Add search domains in Network → Advanced → DNS:

  • Allows typing server instead of server.company.com
  • Useful for internal networks
  • Order matters for resolution priority

Security Recommendations

  1. Use encrypted DNS: Prefer DNS over HTTPS or DNS over TLS
  2. Avoid ISP DNS: They often log queries and inject ads
  3. Regular testing: Periodically check for DNS leaks
  4. Multiple servers: Configure both primary and secondary DNS
  5. VPN integration: Use VPN for complete privacy protection

Need Additional Help?

If you're experiencing issues with DNS configuration or want to learn more about TorGuard's secure DNS services, our support team is here to help.

Contact Support

Was this article helpful?

Share:

Ready to Get Help?

Our support team is available 24/7 to assist you with any questions.