How to Change DNS on iPhone, iPad, and Mac
Configure custom DNS servers on your iPhone, iPad, or Mac. This guide covers iOS Settings, macOS System Settings, Terminal commands, and DNS profiles.
iPhone and iPad (iOS 14+)
iOS handles DNS on a per-network basis. You set DNS servers for each Wi-Fi network individually. These settings do not carry over when you switch networks.
Step 1 — Open Wi-Fi settings
Open Settings and tap Wi-Fi. Find the network you are connected to and tap the (i) button on the right side of the network name.
Step 2 — Configure DNS
Scroll down to the DNS section and tap Configure DNS. By default, this is set to Automatic.
Change it to Manual. This reveals the list of DNS servers your device is currently using.
Step 3 — Remove old servers and add new ones
Tap the red minus icon next to each existing DNS server to remove it. Then tap Add Server and enter your preferred DNS addresses. For example:
1.1.1.1— Cloudflare primary8.8.8.8— Google primary
Add at least two servers from different providers for redundancy.
Step 4 — Save
Tap Save in the top-right corner. The DNS change takes effect immediately for this network.
Keep in mind: these settings only apply to this specific Wi-Fi network. When you connect to a different Wi-Fi or switch to cellular, iOS reverts to the default DNS.
DNS profiles — system-wide DNS on iOS
If you want your DNS servers to apply across all networks — including cellular — you need a DNS configuration profile.
Major DNS providers like Cloudflare, Google, and AdGuard offer downloadable .mobileconfig profiles that set up DNS over HTTPS (DoH) or DNS over TLS (DoT) system-wide.
To install a profile:
- Download the
.mobileconfigfile from your DNS provider's website in Safari. - Go to Settings → General → VPN & Device Management.
- Tap the downloaded profile and follow the prompts to install it.
Once installed, the profile overrides per-network DNS settings and applies to Wi-Fi and cellular connections. To remove it, return to VPN & Device Management and delete the profile.
Mac (macOS Ventura and later)
On macOS Ventura and newer, DNS configuration lives in System Settings under Network. The interface changed from the old System Preferences layout, so the steps below reflect the current design.
Step 1 — Open Network settings
Click the Apple menu () and choose System Settings. Click Network in the left sidebar.
Click Wi-Fi or Ethernet, depending on how you are connected.
Step 2 — Open connection details
Click Details next to your active network name. A dialog opens with tabs for TCP/IP, DNS, WINS, and more.
Step 3 — Add DNS servers
Click the DNS tab. You will see a DNS Servers list, possibly showing addresses in grey text (those come from your router via DHCP).
Click the + button at the bottom of the list and type your DNS server address. Repeat for each server you want to add:
1.1.1.18.8.8.8
Servers you add manually appear in black text and take priority over the greyed-out DHCP entries.
Step 4 — Save
Click OK to close the dialog. Your Mac uses the new DNS servers immediately. No restart needed.
Mac Terminal alternative
If you prefer the command line, open Terminal and run:
sudo networksetup -setdnsservers Wi-Fi 1.1.1.1 8.8.8.8
Replace Wi-Fi with your network service name. To find it, run:
networksetup -listallnetworkservices
Common names include Wi-Fi, Ethernet, and Thunderbolt Ethernet.
To add IPv6 DNS servers as well:
sudo networksetup -setdnsservers Wi-Fi 1.1.1.1 8.8.8.8 2606:4700:4700::1111 2001:4860:4860::8888
To reset DNS back to your router's default (DHCP):
sudo networksetup -setdnsservers Wi-Fi empty
How to verify your DNS servers
On Mac: Open Terminal and run:
nslookup example.com
The "Server" line at the top should show the IP of the DNS server you configured. You can also query a specific server directly:
nslookup example.com 1.1.1.1
To flush the DNS cache on macOS (useful if old entries are cached):
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
On iPhone or iPad: Open Safari and visit a site you have not loaded recently. If it resolves, your DNS is working. For a more thorough check, use the Cloudflare DNS checker or similar tool in your browser to confirm which resolver is answering your queries.
Recommended DNS servers
Not sure which DNS servers to use? We maintain a live-tested directory of public resolvers from around the world, filtered by reliability and response time.
Browse our full directory to find the best servers for your location.
Frequently asked questions
Do iOS DNS settings apply to all Wi-Fi networks?
No. DNS settings on iPhone and iPad are saved per Wi-Fi network. When you connect to a different network, it uses that network's default DNS unless you configure it separately. Use a DNS profile for system-wide settings.
Does changing DNS on my Mac affect other devices on the network?
No. DNS changes in System Settings only affect that Mac. Other devices on the same network keep using whatever DNS their own settings specify, usually the router default.
How do I reset DNS back to automatic on iPhone?
Go to Settings, Wi-Fi, tap the (i) on your network, tap Configure DNS, and switch from Manual back to Automatic. Tap Save.
Will a DNS profile override my Wi-Fi DNS settings?
Yes. A DNS configuration profile applies system-wide and takes priority over per-network Wi-Fi DNS settings. It also covers cellular connections, which manual Wi-Fi settings do not.