keepcalculator

06 Numbers and Powers

How to Use Cloudflare DNS on Mac

Card No. 06·67928 · Updated · Standard formula, shown below

This guide shows you how to change your Mac’s DNS servers to Cloudflare’s 1.1.1.1 service, which can speed up your internet connection and improve privacy. You’ll learn both the graphical method (System Settings) and the command-line method (networksetup), plus how to verify the change and fix common issues.

What You’ll Need

  • A Mac running macOS Ventura (13) or later. The steps are similar for older versions, but the menu names may differ slightly.
  • Administrator access to your Mac (you’ll need to enter your password).
  • Your Wi-Fi or Ethernet connection details (you don’t need to disconnect, just know which network you’re using).

Step-by-Step

Method 1: Using System Settings (Graphical)

  1. Click the Apple menu (top-left corner) and select System Settings.
  2. In the sidebar, click Network.
  3. Select your active connection (e.g., Wi-Fi or Ethernet) on the right side. If you’re on Wi-Fi, click Details next to your network name.
  4. In the connection details window, click DNS in the left column.
  5. Click the + button under the DNS Servers list to add a new server.
  6. Type 1.1.1.1 and press Enter. Then add another server: 1.0.0.1 (this is Cloudflare’s secondary DNS).
  7. If there are any existing DNS servers (like your ISP’s), you can remove them by selecting them and clicking the – button. Leaving them is okay, but Cloudflare will only be used if it’s first in the list.
  8. Click OK or Apply (depending on your macOS version) to save changes.
  9. To ensure the change takes effect, turn your Wi-Fi off and on again, or disconnect and reconnect to your network.

Method 2: Using Terminal (Command Line)

  1. Open Terminal (found in Applications > Utilities).
  2. First, find your network service name. Type: networksetup -listallnetworkservices and press Enter. You’ll see a list like “Wi-Fi”, “Ethernet”, etc. Note the exact name of your active connection.
  3. Set Cloudflare DNS for that service. Replace Wi-Fi with your actual service name: sudo networksetup -setdnsservers Wi-Fi 1.1.1.1 1.0.0.1
  4. Enter your administrator password when prompted (you won’t see characters as you type).
  5. Verify the change by typing: networksetup -getdnsservers Wi-Fi (again, replace Wi-Fi with your service name). You should see the two IP addresses.
  6. Flush the DNS cache to clear old records: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder (press Enter after the first command, then the second).

Common Mistakes

  • Typing the wrong IP address: Cloudflare’s primary is 1.1.1.1, secondary is 1.0.0.1. A common typo is 1.1.1.0 or 1.0.0.0.
  • Not removing old DNS servers: If you leave your ISP’s DNS servers above Cloudflare, your Mac will use them first, defeating the purpose. Make sure Cloudflare is at the top of the list.
  • Forgetting to apply the changes: In System Settings, you must click “OK” or “Apply” to save. Closing the window without doing so reverts your changes.
  • Using the wrong network service: If you’re on Wi-Fi but change the DNS for Ethernet, nothing happens. Always check which service is active.
  • Not flushing the DNS cache: Old cached entries can keep you connected to the old DNS for a while, causing confusion. Always flush after changing.

Tips

  • Use both 1.1.1.1 and 1.0.0.1 for redundancy. If one fails, your Mac automatically uses the other.
  • For a more private option, you can use Cloudflare’s 1.1.1.2 (blocks malware) or 1.1.1.3 (blocks malware and adult content). These are free and work the same way.
  • If you’re a developer, you might want to use the command-line method because it’s faster and can be scripted.
  • Some routers have their own DNS settings. Changing your Mac’s DNS overrides the router’s for that Mac only. If you want all devices on your network to use Cloudflare, change it on your router instead.
  • You can check if Cloudflare is working by visiting https://1.1.1.1/help in your browser. It will show a confirmation that you’re using Cloudflare.

Troubleshooting

DNS change doesn’t seem to take effect

First, verify the change was saved: open System Settings > Network > your connection > DNS. Check that 1.1.1.1 is listed first. Then flush the DNS cache again. If it still doesn’t work, reboot your Mac.

Internet stops working after changing DNS

This usually means the DNS server is unreachable. Try switching back to your old DNS (or set it to 8.8.8.8, Google’s DNS) to see if the internet works. If it does, Cloudflare might be blocked by your ISP or firewall. You can also try using the IPv6 addresses: 2606:4700:4700::1111 and 2606:4700:4700::1001.

Terminal says “You cannot use this command” or “Invalid service”

Double-check the service name. Use networksetup -listallnetworkservices to get the exact name. It’s case-sensitive, so “Wi-Fi” is correct, not “Wifi” or “WiFi”.

My Mac keeps reverting to the old DNS

If you’re using a VPN or a network management tool (like Cisco AnyConnect), they may override DNS settings. Disconnect from the VPN temporarily to test. Also, some public Wi-Fi networks force their own DNS; you can’t override those.

I can’t find the DNS settings in System Settings

Make sure you’re looking at the correct network service. In System Settings > Network, you’ll see a list of services on the right. Click on the one that’s active (has a green dot). For Wi-Fi, you need to click “Details” next to the network name to see the DNS tab.

Frequently Asked Questions

Is Cloudflare DNS free?

Yes, Cloudflare’s 1.1.1.1 DNS service is completely free for personal and commercial use. There’s no limit on queries.

Will Cloudflare DNS make my internet faster?

Often, yes. Cloudflare has a large global network of servers, so the DNS lookup time is usually lower than your ISP’s. However, your actual download speed depends on your broadband connection, not DNS. You may notice faster page loads, especially on new sites.

Does Cloudflare DNS track my browsing?

Cloudflare claims it does not sell your data and only keeps minimal logs for security purposes. They have a strong privacy policy, but if you’re concerned, you can use their privacy-focused version at 1.1.1.1.

Can I use Cloudflare DNS on my iPhone or iPad?

Yes, you can change DNS settings on iOS devices in Settings > Wi-Fi > tap the (i) icon next to your network > Configure DNS > Manual. Add 1.1.1.1 and 1.0.0.1. The process is similar to Mac.

What’s the difference between 1.1.1.1 and 1.1.1.2?

1.1.1.1 is the standard DNS. 1.1.1.2 blocks known malware domains, and 1.1.1.3 blocks both malware and adult content. All are free and use the same setup process.

How do I revert to my original DNS settings?

Go back to System Settings > Network > your connection > DNS, and either remove the Cloudflare entries or click the “Use DHCP” button (or “Automatic”) to let your router assign DNS automatically. For Terminal, use sudo networksetup -setdnsservers Wi-Fi Empty to clear all DNS servers.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →