Why Change Your DNS
Your internet provider assigns you a DNS server by default. That server works, but it is rarely the fastest option available. ISP DNS servers are often overloaded, geographically distant, and optimized for cost rather than performance. For most people, switching to a dedicated public DNS provider shaves 20 to 100 milliseconds off every domain lookup.
That might sound small, but consider what happens when you open a single webpage. Your browser does not just look up one domain. It resolves the main site, then the CDN hosting images, the font provider, the analytics script, the advertising network, and the video embed. A modern page triggers 30 to 50 DNS lookups. If your current resolver adds 50 milliseconds to each one, you are burning two and a half seconds before a page even starts to load.
Beyond speed, there are privacy reasons too. Many ISP DNS servers log every domain you visit and retain those logs for months or years. Some hijack failed lookups and redirect you to ad-filled search pages. A privacy-focused resolver like Cloudflare 1.1.1.1 or Quad9 9.9.9.9 gives you a faster experience and keeps your browsing history out of your ISP's logs.
The best part is that changing your DNS is completely free, takes about five minutes, and is instantly reversible. You are not locked in. If the new server does not work well for you, just revert the settings and you are back where you started.
Before You Start
Pick the DNS servers you want to use first. If you are not sure, here are the three most popular options:
- Cloudflare 1.1.1.1 — fastest overall, strong privacy. Primary: 1.1.1.1, Secondary: 1.0.0.1
- Google Public DNS 8.8.8.8 — reliable, widely used. Primary: 8.8.8.8, Secondary: 8.8.4.4
- Quad9 9.9.9.9 — built-in security blocking. Primary: 9.9.9.9, Secondary: 149.112.112.112
You can enter both the primary and secondary addresses, or just the primary. The secondary acts as a backup if the primary is unreachable. Most systems let you add multiple servers and will try them in order.
For the most accurate choice, run our DNS speed test first. It shows you exactly which resolver is fastest from your current location, so you are not guessing.
One more thing: changing DNS on a single device only affects that device. If you want every device on your home network to use the new DNS, change it at the router level instead. The router section at the end covers this.
How to Change DNS on Windows 10 and 11
Windows offers two ways to change DNS: through the modern Settings app or through the classic Control Panel. Both work. The Settings app is faster for most people.
Method 1: Windows Settings (Recommended)
- Open the Start menu and click the gear icon to open Settings. You can also press Windows + I to open it directly.
- Click Network & Internet in the left sidebar.
- Click Wi-Fi if you are on a wireless connection, or Ethernet if you are wired.
- Click Hardware properties (Windows 11) or Change adapter options then right-click your connection and choose Properties (Windows 10).
- Scroll down to DNS server assignment and click Edit.
- In the dropdown, change Automatic (DHCP) to Manual.
- Toggle on IPv4 (and IPv6 if your provider supports it).
- Enter your preferred DNS addresses:
- Preferred DNS: 1.1.1.1
- Alternate DNS: 1.0.0.1
- Click Save.
Method 2: Control Panel
- Press Windows + R, type ncpa.cpl, and press Enter. This opens Network Connections directly.
- Right-click your active connection (Wi-Fi or Ethernet) and select Properties.
- Select Internet Protocol Version 4 (TCP/IPv4) and click Properties.
- Select Use the following DNS server addresses.
- Enter 1.1.1.1 as Preferred DNS and 1.0.0.1 as Alternate DNS.
- Click OK, then close all dialogs.
For IPv6 (Optional)
If you also want to set IPv6 DNS, go back to the properties window, select Internet Protocol Version 6 (TCP/IPv6), click Properties, and enter:
- Preferred DNS: 2606:4700:4700::1111
- Alternate DNS: 2606:4700:4700::1001
Flush DNS Cache on Windows
After changing DNS, flush the old cache so your system starts using the new resolver immediately. Open Command Prompt as Administrator and run:
ipconfig /flushdns
You should see a confirmation message. See our complete DNS flush guide for more details.
How to Change DNS on macOS
macOS handles DNS through System Settings. The process is straightforward and takes about two minutes.
- Click the Apple menu in the top-left corner and select System Settings (or System Preferences on older macOS versions).
- Click Network in the sidebar.
- Select your active connection — Wi-Fi on the left if wireless, or Ethernet if wired.
- Click Details (or Advanced on older versions) in the bottom-right.
- Click the DNS tab.
- Under DNS Servers, click the + button at the bottom.
- Type 1.1.1.1 and press Enter.
- Click + again and type 1.0.0.1.
- If you see existing DNS servers listed (like your ISP's addresses), select them and click the - button to remove them.
- Click OK, then click Apply.
macOS applies the changes immediately. There is no need to restart or flush the cache, but if you want to be thorough, open Terminal and run:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
This flushes both the DNS cache and the mDNS resolver. You will need to enter your Mac login password when prompted. See our DNS cache flush guide for platform-specific commands.
Setting DNS for a Specific Wi-Fi Network Only
If you want different DNS servers for different Wi-Fi networks (like one for home and a different one for your office), you can configure per-network DNS in the same DNS tab. macOS remembers DNS settings per network, so the changes only apply to the network you are currently editing.
How to Change DNS on iPhone and iPad
iOS lets you change DNS on a per-Wi-Fi-network basis. You cannot change DNS for cellular data without a VPN or profile, but Wi-Fi covers most home use cases.
- Open the Settings app on your iPhone or iPad.
- Tap Wi-Fi.
- Find your connected Wi-Fi network and tap the blue info icon (i) next to it.
- Scroll down and tap Configure DNS.
- Switch from Automatic to Manual.
- Tap Add Server and type 1.1.1.1.
- Tap Add Server again and type 1.0.0.1.
- If you see your ISP's DNS server listed, tap the red minus icon next to it and tap Delete to remove it.
- Tap Save in the top-right corner.
The changes take effect immediately for that Wi-Fi network. Your iPhone will remember these DNS settings every time you connect to this specific network.
To revert, go back to Configure DNS and switch it back to Automatic. iOS will clear the manual entries and resume using the router-assigned DNS.
Important Note on iOS
iOS does not allow you to set DNS for cellular connections through Settings alone. If you want encrypted DNS on cellular, consider using a DNS profile or a VPN app that supports DNS over HTTPS. Some DNS providers like Cloudflare offer free iOS profiles that enable DNS over TLS system-wide.
How to Change DNS on Android
Android 9 and later supports Private DNS, which encrypts your DNS queries using DNS over TLS. This is the recommended method on modern Android devices.
Private DNS (Android 9+) — Recommended
- Open Settings on your Android device.
- Tap Network & Internet (or Connections on Samsung devices).
- Tap Private DNS. You may need to scroll down to find it.
- Select Private DNS provider hostname.
- Enter the provider hostname:
- For Cloudflare: one.one.one.one
- For Google: dns.google
- For Quad9: dns.quad9.net
- Tap Save.
That is it. Your Android device now sends all DNS queries over an encrypted connection. You do not need to enter numeric IP addresses for Private DNS — it uses hostnames.
Per-Wi-Fi Network DNS (Alternative)
If your Android version does not support Private DNS, or you want to set DNS for a specific Wi-Fi network only:
- Open Settings and go to Wi-Fi.
- Long-press your connected network and tap Modify network (or tap the gear icon).
- Tap Advanced options.
- Under IP settings, change DHCP to Static.
- Scroll to DNS 1 and enter 1.1.1.1.
- Enter 1.0.0.1 in DNS 2.
- Tap Save.
Keep in mind that setting a static IP configuration means you are also setting a static IP address, gateway, and network prefix. If you are not sure what these values should be, use the Private DNS method instead — it is simpler and more secure.
Verify Private DNS Is Working
Open a browser and visit https://one.one.one.one (for Cloudflare) or https://dns.google (for Google). If the page loads and confirms you are using their DNS, the change worked.
How to Change DNS on Linux
Linux gives you multiple ways to change DNS, depending on your distribution and whether you use a desktop environment with NetworkManager or a headless server.
Using NetworkManager (Desktop Linux)
Most desktop Linux distributions (Ubuntu, Fedora, Mint, Pop!_OS) use NetworkManager. The easiest way is through the GUI:
- Open Settings and go to Network.
- Click the gear icon next to your active connection.
- Go to the IPv4 tab.
- Under Additional DNS servers, enter: 1.1.1.1, 1.0.0.1
- Click Apply and reconnect to the network.
Using the Command Line
For NetworkManager-based systems, use nmcli:
nmcli con mod "Wi-Fi Name" ipv4.dns "1.1.1.1 1.0.0.1"
nmcli con mod "Wi-Fi Name" ipv4.ignore-auto-dns yes
nmcli con up "Wi-Fi Name"
Replace "Wi-Fi Name" with your actual connection name. Run nmcli con show to see all connections.
Editing resolv.conf (Servers and Older Systems)
On systems without NetworkManager (like Ubuntu Server), edit the resolver configuration directly:
- Open
/etc/resolv.conf with a text editor: sudo nano /etc/resolv.conf
- Find the line starting with
nameserver and replace the existing IP with your preferred DNS.
- Add a second line for the backup DNS if needed.
The file should look like this:
nameserver 1.1.1.1
nameserver 1.0.0.1
Save the file and exit. On modern systems, this file may be managed by systemd-resolved. In that case, edit /etc/systemd/resolved.conf instead and set the DNS entries under the [Resolve] section, then run sudo systemctl restart systemd-resolved.
Using systemd-resolved (Ubuntu 18.04+)
Ubuntu and many modern distributions use systemd-resolved as the default DNS stub resolver. To configure it:
- Edit
/etc/systemd/resolved.conf: sudo nano /etc/systemd/resolved.conf
- Uncomment the
DNS= line and add your servers: DNS=1.1.1.1 1.0.0.1
- Uncomment
FallbackDNS= and set a backup if desired.
- Save the file and restart the service:
sudo systemctl restart systemd-resolved
- Verify:
resolvectl status
How to Change DNS on Your Router
Changing DNS at the router level means every device on your network — phones, laptops, smart TVs, game consoles, IoT devices — automatically uses the new DNS without any individual configuration. This is the most efficient way to update DNS for your entire household.
Step-by-Step Router Configuration
- Find your router's IP address. On most networks it is 192.168.1.1 or 192.168.0.1. On Windows, run
ipconfig in Command Prompt and look for "Default Gateway." On Mac, go to System Settings, Network, and check your connection details.
- Open a browser and type the router IP address into the address bar. Press Enter.
- Log in with your router credentials. The default is usually admin/admin or admin/password. If you changed the password and forgot it, you may need to reset the router to factory settings.
- Find the DNS settings. This varies by router brand:
- TP-Link: Advanced > Network > DHCP Server > Primary/Secondary DNS
- Netgear: Advanced > Setup > Internet Setup > Domain Name Server (DNS) Address
- ASUS: WAN > Internet Connection > WAN DNS Settings
- Linksys: Connectivity > Internet Settings > Static DNS
- Google Nest/Google WiFi: Network & general > Advanced networking > DNS
- Change the DNS setting from Get Automatically from ISP (or similar) to Use the following DNS server addresses.
- Enter your preferred DNS: 1.1.1.1 (Primary) and 1.0.0.1 (Secondary).
- Click Save or Apply.
- Restart your router by unplugging it for 30 seconds and plugging it back in.
After the router restarts, all connected devices will use the new DNS servers. You do not need to reconfigure anything on individual devices.
What If My ISP Locks DNS Settings?
Some ISPs configure their routers to force their own DNS and prevent changes. If the DNS fields are grayed out or reset after saving, your ISP may have locked the settings. In that case, your options are:
- Set DNS on individual devices instead of the router.
- Use a custom firmware like DD-WRT or OpenWrt if your router supports it.
- Replace the ISP router with your own router and keep the ISP modem in bridge mode.
DHCP vs. WAN DNS
Some routers have two places to set DNS: WAN DNS (for the internet connection) and DHCP DNS (what gets handed out to devices). If you change WAN DNS but devices are still getting the old DNS, check the DHCP settings too. Set both to your preferred DNS addresses for consistency.
Recommended DNS Servers to Use
Here is a quick reference table of the best public DNS servers. Pick the one that fits your priorities — speed, security, privacy, or family filtering.
| Provider |
Primary DNS |
Secondary DNS |
Best For |
Key Feature |
| Cloudflare |
1.1.1.1 |
1.0.0.1 |
Speed |
Fastest global resolver, logs purged in 24h |
| Google |
8.8.8.8 |
8.8.4.4 |
Reliability |
Near-100% uptime, massive infrastructure |
| Quad9 |
9.9.9.9 |
149.112.112.112 |
Security |
Blocks malicious domains, DNSSEC enforced |
| OpenDNS |
208.67.222.222 |
208.67.220.220 |
Family filtering |
Content filtering, phishing protection |
| Cloudflare (Family) |
1.1.1.3 |
1.0.0.3 |
Families |
Blocks adult content, malware |
| NextDNS |
Custom |
Custom |
Customization |
Analytics, DoH/DoT/DoQ, ad blocking |
| AdGuard DNS |
94.140.14.14 |
94.140.15.15 |
Ad blocking |
Built-in ad and tracker blocking |
For the most accurate recommendation, run our DNS speed test from your current location. Global averages do not account for your specific network peering arrangements. See also our fastest DNS comparison and complete DNS server list for more options.
How to Flush DNS Cache
After changing your DNS server, your device may still have old results cached from the previous resolver. Flushing the DNS cache forces your device to start fresh with the new server.
Here is the quick version for each platform:
- Windows: Open Command Prompt as Administrator and run
ipconfig /flushdns
- macOS: Open Terminal and run
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
- Linux (systemd-resolved): Run
sudo resolvectl flush-caches
- Linux (nscd): Run
sudo systemctl restart nscd
- Android: Toggle airplane mode on and off, or restart the device
- iOS: Toggle airplane mode on and off, or restart the device
You do not always need to flush the cache. Most systems will gradually replace old entries as they expire. But if you want immediate results — for example, to run a speed test and see the new DNS performance — flushing ensures a clean slate.
For a more detailed walkthrough, see our complete guide to flushing DNS cache on every platform.
How to Test If It Worked
After changing your DNS settings, you want to confirm two things: that the new DNS is actually being used, and that it performs better than what you had before.
Verify DNS Is Active
The simplest way to check is to visit a DNS verification page. Most DNS providers have one:
- Cloudflare: visit https://1.1.1.1 — it will confirm you are using Cloudflare DNS
- Google: visit https://dns.google — it will show your current DNS provider
- Quad9: visit https://quad9.net — it confirms Quad9 is active
Alternatively, open a terminal or command prompt and run a DNS lookup against a known domain. On Windows: nslookup example.com. On Mac/Linux: dig example.com. The response should show the IP address of your new DNS provider, not your ISP's.
Test the Speed Difference
Once you know the new DNS is active, measure the improvement. Run our DNS speed test with the new settings and compare the results to what you had before. Run the test two or three times at different times of day for consistent numbers.
You can also compare against other DNS providers. Our tool tests 17+ servers simultaneously, so you can see exactly how your new choice stacks up against alternatives. If the results surprise you, switch to the fastest one and test again.
What to Look For
Focus on median response time rather than average. A few slow responses can skew the average, but the median gives you a better picture of typical performance. Also check the success rate — if a server fails queries, that is a problem regardless of speed.
Read our complete DNS guide for a deeper understanding of how DNS resolution works and what the numbers actually mean.
Frequently Asked Questions
Will changing my DNS affect my internet speed?
Changing DNS does not increase your download or upload bandwidth. What it does improve is how quickly domain names are resolved into IP addresses. Faster DNS resolution means websites start loading sooner. The difference is most noticeable on pages that pull resources from many different domains — which is most modern websites. You can expect 20 to 100 milliseconds improvement per DNS lookup, which adds up across the dozens of lookups a typical page triggers.
Is it safe to change my DNS server?
Yes. Changing DNS only affects how your device translates domain names into IP addresses. It does not affect your files, installed programs, or any other aspect of your computer. Public DNS servers from providers like Cloudflare, Google, and Quad9 are trusted by millions of users worldwide. The change is also completely reversible — you can switch back to your ISP's DNS at any time.
Can I undo the change if something goes wrong?
Absolutely. On every platform, you can revert DNS settings back to automatic or your previous values in the same menu where you made the change. On Windows and Mac, switch the DNS setting back to "Obtain DNS server address automatically." On iOS, switch from Manual back to Automatic. On Android Private DNS, select "Off" or "Automatic." Your internet will work normally with the old DNS within seconds.
Does changing DNS on my router affect all devices?
Yes. When you change DNS at the router level, every device that connects to that router — phones, laptops, tablets, smart TVs, game consoles, smart home devices — will automatically use the new DNS. This is the most efficient way to update DNS for your entire household without configuring each device individually.
Will changing DNS help with slow websites?
It depends on the cause of the slowness. If the issue is slow DNS resolution, then yes — switching to a faster resolver can help significantly. But if the slowness is due to low bandwidth, congested servers, or poor Wi-Fi signal, DNS changes will not fix those problems. Run our DNS speed test first to see if DNS is the bottleneck.
Do I need to change DNS on every device?
If you change DNS at the router level, no — every device on your network will use the new DNS automatically. If you change DNS on a single device only, then yes — other devices will continue using the old DNS. For most households, changing DNS at the router is the simplest approach.