How to Change DNS on Mac (Step-by-Step)
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.
Table of contents
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)
- Open System Settings
Open System Settings from the Apple menu. - Select your network
Go to Wi-Fi (or Network > Ethernet if you use a cable). Click the ⓘ info button next to your active network. - Open DNS settings
Select DNS in the left sidebar of the network details. - Add DNS servers
Click + under DNS Servers. Enter the primary and secondary IPs (for example,1.1.1.1and1.0.0.1). Press OK or Done. - Reorder or remove (optional)
Drag servers to set priority. Select a server and press – to remove it. - Apply changes
Click OK or Apply to save. Reconnect to the network if your Mac prompts you. - Flush the DNS cache (recommended)
Open Terminal and run:sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderEnter 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.
Access content across the globe at the highest speed rate.
70% of our readers choose Private Internet Access
70% of our readers choose ExpressVPN
Browse the web from multiple devices with industry-standard security protocols.
Faster dedicated servers for specific actions (currently at summer discounts)
Method 2: Change DNS with Terminal (Power Users)
- List network services
Open Terminal, then run:networksetup -listallnetworkservicesNote the exact service name, such asWi-FiorEthernet. - 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 - Verify the new DNS
Check the resolver details:scutil --dnsYou can also test resolution with:dig example.comornslookup example.com - 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.
Quick Comparison: Popular DNS Options
| Provider | Primary (IPv4) | Secondary (IPv4) | Strengths | When to Use |
|---|---|---|---|---|
| Cloudflare | 1.1.1.1 | 1.0.0.1 | Fast resolution, strong privacy | General use, privacy-minded users |
| Google DNS | 8.8.8.8 | 8.8.4.4 | Global reach, stability | Reliability across regions |
| Quad9 | 9.9.9.9 | 149.112.112.112 | Malware blocking, security focus | Extra threat blocking |
| OpenDNS | 208.67.222.222 | 208.67.220.220 | Optional filtering, parental tools | Home 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
DNS translates domain names into IP addresses. Faster, more reliable DNS can speed up the first part of every connection and reduce failures.
It can reduce lookup time and improve reliability. It won’t increase your line’s bandwidth, but pages can start loading sooner.
Add IPv6 servers if your ISP and network use IPv6. If you see issues, remove them and stick with IPv4.
Return to System Settings > Wi-Fi/Ethernet > ⓘ > DNS, remove custom entries, and apply. Or run:
sudo networksetup -setdnsservers “Wi-Fi” empty
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.
Read our disclosure page to find out how can you help VPNCentral sustain the editorial team Read more
User forum
0 messages