Why Change DNS on Your Mac
macOS uses the DNS servers your router hands out, which usually come from your ISP (e& or Du). Switching to a faster, privacy-focused resolver can shorten the delay before pages load, block malicious sites, and — with an encrypted profile — hide your lookups from anyone on the network. If DNS is new to you, read What Is DNS first.
Change DNS in System Settings
- Open System Settings → Network
- Select your active connection (Wi-Fi or Ethernet)
- Click Details… (or the "…" menu next to the connection)
- Go to the DNS tab
- Under DNS Servers, click the + button and add each server IP
- Click OK, then Apply
On older macOS versions the path is System Preferences → Network → Advanced → DNS.
Recommended DNS Servers
| Provider | Primary | Secondary | Best for |
|---|---|---|---|
| Cloudflare | 1.1.1.1 | 1.0.0.1 | Speed & privacy |
| 8.8.8.8 | 8.8.4.4 | Reliability | |
| Quad9 | 9.9.9.9 | 149.112.112.112 | Security |
Enable Encrypted DNS (DoH / DoT)
The built-in Network panel only sets plain DNS. To encrypt your queries, install a configuration profile: Cloudflare and NextDNS both provide a downloadable .mobileconfig file that enables DNS over HTTPS or DNS over TLS system-wide. Open the file, then approve it in System Settings → Privacy & Security → Profiles.
Flush the DNS Cache
Open Terminal and run these two commands together:
- sudo dscacheutil -flushcache
- sudo killall -HUP mDNSResponder
Enter your admin password when prompted. This clears any stale cached lookups.
Verify the Change
In Terminal, run dig @1.1.1.1 example.com or nslookup example.comto see which server answers. For Cloudflare, open 1.1.1.1/help in Safari to confirm. DNS changes don't affect bandwidth — measure that with a speed test, and see your full connection details on What's My IP.