How to Change DNS on Mac (Step-by-Step)


how to change dns on mac

You can speed up lookups, boost reliability, and improve privacy by changing DNS on your Mac. The process takes a few minutes. You can use System Settings or the Terminal, then verify everything with simple commands.

Before You Start

  • Pick a DNS provider and note the IPv4 (and optional IPv6) addresses.
  • Decide whether you want this change for Wi-Fi, Ethernet, or both.
  • Sign in with an admin account so you can save network changes.
  • Write down your current DNS settings so you can revert if needed.

Method 1: Change DNS via System Settings (Sonoma/Sequoia)

  1. Open System Settings
    Open System Settings from the Apple menu.
  2. Select your network
    Go to Wi-Fi (or Network > Ethernet if you use a cable). Click the info button next to your active network.
  3. Open DNS settings
    Select DNS in the left sidebar of the network details.
  4. Add DNS servers
    Click + under DNS Servers. Enter the primary and secondary IPs (for example, 1.1.1.1 and 1.0.0.1). Press OK or Done.
  5. Reorder or remove (optional)
    Drag servers to set priority. Select a server and press to remove it.
  6. Apply changes
    Click OK or Apply to save. Reconnect to the network if your Mac prompts you.
  7. Flush the DNS cache (recommended)
    Open Terminal and run:
    sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder Enter your password. This forces macOS to use your new DNS immediately.

Gamers often notice better latency when switching to a faster resolver. If that’s your goal, see this guide on improving gaming performance by changing DNS.

Method 2: Change DNS with Terminal (Power Users)

  1. List network services
    Open Terminal, then run:
    networksetup -listallnetworkservices Note the exact service name, such as Wi-Fi or Ethernet.
  2. Set DNS servers for a service
    Replace the service name and add your servers:
    sudo networksetup -setdnsservers "Wi-Fi" 1.1.1.1 1.0.0.1
  3. Verify the new DNS
    Check the resolver details:
    scutil --dns You can also test resolution with:
    dig example.com or
    nslookup example.com
  4. Revert to automatic (DHCP)
    If you want the default behavior back:
    sudo networksetup -setdnsservers "Wi-Fi" empty

If you need a broader step-by-step that covers other systems too, check out this walkthrough on changing DNS across platforms.

ProviderPrimary (IPv4)Secondary (IPv4)StrengthsWhen to Use
Cloudflare1.1.1.11.0.0.1Fast resolution, strong privacyGeneral use, privacy-minded users
Google DNS8.8.8.88.8.4.4Global reach, stabilityReliability across regions
Quad99.9.9.9149.112.112.112Malware blocking, security focusExtra threat blocking
OpenDNS208.67.222.222208.67.220.220Optional filtering, parental toolsHome networks, content filters

Note: You can add IPv6 servers if you use IPv6. Keep only a few entries so macOS resolves predictably.

Tips for a Smooth Switch

  • Change DNS on each active interface (Wi-Fi and Ethernet) if you swap between them.
  • Keep the fastest server first in the list; your Mac tries it before others.
  • Flush the cache after changes to avoid stale lookups.
  • If your router forces its own DNS, change DNS on the router as well for consistency.
  • Track performance with quick tests at different times of day.

Windows users can follow similar steps—see the dedicated guides for changing DNS in Windows 10 or Windows 11.

On mobile devices, DNS setup can create leaks if not configured correctly. Here’s how to fix DNS leaks on Android.

If you’re using a VPN, you might wonder what happens with DNS. This explainer covers how VPNs handle DNS encryption and why that matters.

FAQs

What does DNS do on a Mac?

DNS translates domain names into IP addresses. Faster, more reliable DNS can speed up the first part of every connection and reduce failures.

Will changing DNS make my internet faster?

It can reduce lookup time and improve reliability. It won’t increase your line’s bandwidth, but pages can start loading sooner.

Should I add IPv6 DNS too?

Add IPv6 servers if your ISP and network use IPv6. If you see issues, remove them and stick with IPv4.

How do I revert to my default DNS?

Return to System Settings > Wi-Fi/Ethernet > ⓘ > DNS, remove custom entries, and apply. Or run:
sudo networksetup -setdnsservers “Wi-Fi” empty

Why doesn’t the change seem to work?

Flush the cache, disconnect and reconnect to the network, and check that you edited the active interface. If your router overrides DNS, change the router’s DNS too.

Conclusion

You control DNS on your Mac in a few clear steps. Set the servers, apply the change, flush the cache, and verify. If performance or reliability improves, keep the setup. If not, try another provider or revert to automatic. This quick workflow gives you the flexibility to tune speed, uptime, and security on your Mac. If you’re also managing a Linux system, check out the guide on how to change DNS on Linux, it walks you through the equivalent steps using Network Manager or terminal commands.

Readers help support VPNCentral. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help VPNCentral sustain the editorial team Read more

User forum

0 messages