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:
- You have administrator privileges on your computer (required to apply network settings).
- You are connected to the internet.
- 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)
- Cloudflare:
Method 1: Through System Settings (Recommended)
This is the simplest and most visual method, suitable for most users.
Step 1: Open Network Settings
- Click the Apple menu in the top-left corner of your screen.
- Select System Settings.
- 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
- A new window will open. Navigate to the DNS tab.
- 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).
- 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.
- 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.
- Open Terminal via Spotlight (
Cmd+Space, type "Terminal") or Finder → Applications → Utilities. - Identify your network service name. Enter the command:
In the output, find your connection (e.g.,networksetup -listallnetworkservicesWi-FiorEthernet). The name may vary. - 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.
Enter your administrator password when prompted.sudo networksetup -setdnsservers "Service name" 1.1.1.1 1.0.0.1 - To revert to automatic DNS configuration (obtained via DHCP/router), run:
sudo networksetup -setdnsservers "Service name" DHCP - 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.
- Install and launch the Murus utility (if you already have it).
- Navigate to the network or DNS settings section.
- Add your preferred DNS servers to the list.
- 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.
- Simplest method: Open any website that previously loaded slowly or with errors (e.g.,
youtube.comorgithub.com). If performance improves — the configuration was successful. - Precise check via Terminal:
- Use the
dig(Domain Information Groper) command to query domain information.
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).dig fixpedia.ru- To explicitly see which server responded, run:
Replacedig @1.1.1.1 fixpedia.ru1.1.1.1with any of your DNS servers. If the query completes without errors, the connection to that server works. - Use the
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.