macOS

Changing DNS on macOS: 3 Simple Ways to Speed Up Internet

This guide helps you change DNS servers in macOS via System Preferences or Terminal. Learn to use public DNS for improved speed and security, and verify your settings.

Updated at February 16, 2026
10-15 minutes
Easy
FixPedia Team
Применимо к:macOS Sonoma 14macOS Ventura 13macOS Monterey 12macOS Big Sur 11

Introduction / Why This Is Needed

DNS servers (Domain Name System) translate user-friendly website names (e.g., fixpedia.ru) into IP addresses that computers understand. By default, your internet service provider (ISP) supplies its own DNS servers, which can be slow, insecure, or subject to censorship.

Switching to public DNS servers (Cloudflare, Google, Quad9) offers these advantages:

  • Faster website loading — modern servers have global networks and fast caches.
  • Enhanced security — many public DNS services block known phishing and malicious domains.
  • Privacy — some providers do not log your queries (e.g., Cloudflare).
  • Bypassing blocks — if your ISP restricts access to certain resources.

This guide describes three ways to change DNS settings on macOS: via the graphical interface (the simplest), through Terminal, and using a third-party utility.

Prerequisites / Preparation

Before you begin, ensure:

  1. You have administrator privileges on your computer (required to apply network settings).
  2. You are connected to the internet.
  3. You have chosen your DNS servers. Here are popular options:
    • Cloudflare: 1.1.1.1, 1.0.0.1 (IPv4) / 2606:4700:4700::1111, 2606:4700:4700::1001 (IPv6)
    • Google DNS: 8.8.8.8, 8.8.4.4 (IPv4) / 2001:4860:4860::8888, 2001:4860:4860::8844 (IPv6)
    • Quad9 (security-focused): 9.9.9.9 (IPv4)

This is the simplest and most visual method, suitable for most users.

Step 1: Open Network Settings

  1. Click the Apple menu  in the top-left corner of your screen.
  2. Select System Settings.
  3. In the left sidebar, find and select Network.

Step 2: Select Your Active Connection

On the right side of the window, you'll see a list of network interfaces. The active connection will be marked with a green dot.

  • For Wi-Fi: click on Wi-Fi.
  • For a wired Ethernet connection: click on Ethernet.

Click the Advanced button in the bottom-right corner.

Step 3: Configure DNS Servers

  1. A new window will open. Navigate to the DNS tab.
  2. You'll see a list of current DNS servers. To add new ones:
    • Click the + (plus) button below the list.
    • Enter the address of the first DNS server (e.g., 1.1.1.1).
    • Click + again and enter the second DNS server (e.g., 1.0.0.1).
  3. Important: Ensure the new servers are at the top of the list. macOS uses DNS servers in order. To reorder, select a server and use the up/down arrows.
  4. To remove your ISP's old DNS server, select it in the list and click the - (minus) button.

Step 4: Apply Changes

Click OK to close the advanced settings window. Then, in the main Network window, click Apply. The system may briefly reconnect to the network.

Method 2: Through Terminal (For Advanced Users)

This method is useful for automation, remote management, or if the graphical interface is unavailable for some reason.

  1. Open Terminal via Spotlight (Cmd+Space, type "Terminal") or Finder → Applications → Utilities.
  2. Identify your network service name. Enter the command:
    networksetup -listallnetworkservices
    
    In the output, find your connection (e.g., Wi-Fi or Ethernet). The name may vary.
  3. Set DNS servers for the selected service. Replace "Service name" with your actual service name (e.g., "Wi-Fi"). Use quotes if the name contains spaces.
    sudo networksetup -setdnsservers "Service name" 1.1.1.1 1.0.0.1
    
    Enter your administrator password when prompted.
  4. To revert to automatic DNS configuration (obtained via DHCP/router), run:
    sudo networksetup -setdnsservers "Service name" DHCP
    
  5. To check the current DNS servers for a service:
    networksetup -getdnsservers "Service name"
    

Method 3: Using a Third-Party Utility (Murus Firewall)

For users who prefer managing network settings through a unified interface or use the Murus firewall, DNS can be configured via its control panel. This method is less common but may be convenient in complex network setups.

  1. Install and launch the Murus utility (if you already have it).
  2. Navigate to the network or DNS settings section.
  3. Add your preferred DNS servers to the list.
  4. Save and apply the rules. The utility will automatically modify the system's network settings.

Note: This method requires third-party software and is not a standard macOS configuration method.

Verifying the Result

After configuring DNS, it's important to confirm that your DNS queries are actually going to the new servers.

  1. Simplest method: Open any website that previously loaded slowly or with errors (e.g., youtube.com or github.com). If performance improves — the configuration was successful.
  2. Precise check via Terminal:
    • Use the dig (Domain Information Groper) command to query domain information.
    dig fixpedia.ru
    
    In the output, find the ANSWER SECTION. The line for the domain will show the IP address returned by the DNS server. The most important parameter is Query time (query duration). It should be low (typically < 50 ms for a good DNS).
    • To explicitly see which server responded, run:
    dig @1.1.1.1 fixpedia.ru
    
    Replace 1.1.1.1 with any of your DNS servers. If the query completes without errors, the connection to that server works.

Potential Issues

  • Websites don't load after changing DNS.
    • Solution: Check that you entered the DNS server IP addresses correctly (no extra spaces). Try temporarily reverting to automatic settings (DHCP) to confirm the issue is specifically with DNS and not the network itself.
  • Changes don't take effect.
    • Solution: Ensure you clicked the Apply button after editing settings. In Method 2 (Terminal), verify that the network service name is correct.
  • Very slow DNS response.
    • Solution: The DNS server you selected might be geographically distant or temporarily overloaded. Try a different public DNS from the list above (e.g., Cloudflare instead of Google). Also, check if your local firewall or antivirus is blocking outgoing DNS queries (port 53).
  • Some sites remain inaccessible.
    • Solution: The problem may not be DNS-related. Check if the site loads from another device on the same network. If not, it might be blocked at the ISP level or you have routing issues.

F.A.Q.

Do I need to restart my Mac after changing DNS?
Which public DNS is better: Cloudflare (1.1.1.1) or Google (8.8.8.8)?
Can I set DNS for only one network (e.g., Wi-Fi)?
What to do if websites don't open after changing DNS?

Hints

Open Network Settings
Specify DNS Servers
Apply Changes
FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community