How to Change Your DNS Server — Step-by-Step Guide (Windows, Mac, Linux, Router)

Last Updated: October 2026

Key Takeaways

  • ✓ Changing your DNS server can improve browsing speed, boost privacy, add malware filtering, and fix DNS resolution errors.
  • ✓ The top public DNS servers are Cloudflare (1.1.1.1), Google (8.8.8.8), and Quad9 (9.9.9.9) — all free and significantly faster than most ISP DNS servers.
  • ✓ You can change DNS on individual devices (Windows, Mac, Linux, iPhone, Android) or on your router so every device on the network benefits automatically.
  • ✓ Enable DNS-over-HTTPS (DoH) for encrypted DNS queries that prevent ISPs and attackers from snooping on your browsing.
  • ✓ Always verify the change with nslookup or our DNS Lookup tool to confirm your queries are going to the right server.

Why Change Your DNS Server?

Every time you visit a website, your device asks a DNS (Domain Name System) server to translate the domain name — like example.com — into the numerical IP address the internet uses for routing. By default, your device uses the DNS servers assigned by your Internet Service Provider (ISP). These work, but they're often not the best option. Here's why millions of users switch to a third-party DNS:

Speed

ISP DNS servers are notoriously variable in performance. They may be located far from your region, overloaded during peak hours, or poorly maintained. Public DNS providers like Cloudflare and Google operate global anycast networks with servers in hundreds of cities. Independent benchmarks consistently show Cloudflare's 1.1.1.1 resolving queries in under 12 ms on average, compared to 30–70 ms for many ISP resolvers. That difference adds up: every web page triggers dozens of DNS lookups, so shaving 20–50 ms per lookup can noticeably reduce page load times.

Privacy

Your ISP's DNS servers can log every domain you visit, and in many countries ISPs are legally permitted — or even required — to retain and sell this data. Public DNS providers like Cloudflare have committed to never selling user data and purging all logs within 24 hours (audited by KPMG). Pairing a privacy-focused DNS with DNS-over-HTTPS (DoH) encrypts your queries so even your ISP cannot see which domains you're resolving.

Security

Some DNS servers offer built-in protection against malware and phishing. Quad9 (9.9.9.9) blocks known malicious domains using threat intelligence feeds. Cloudflare 1.1.1.2 blocks malware, and 1.1.1.3 blocks both malware and adult content. OpenDNS provides customizable content filtering. These protections work at the DNS level, meaning they block threats before your browser even connects to the dangerous server.

Reliability

ISP DNS outages cause the dreaded "DNS Server Not Responding" error. Public DNS providers maintain redundant infrastructure across multiple data centers and continents. Google Public DNS and Cloudflare both advertise 100% uptime SLAs. If your ISP's DNS goes down, having a public DNS configured as your secondary (or primary) server means your internet keeps working. See our How to Fix DNS Server Not Responding guide for more troubleshooting steps.

Best Public DNS Servers Compared

Before changing your DNS, you need to decide which provider to use. Here are the top options in 2026:

Cloudflare DNS — 1.1.1.1

  • Primary: 1.1.1.1  |  Secondary: 1.0.0.1
  • IPv6: 2606:4700:4700::1111 / 2606:4700:4700::1001
  • Best for: Raw speed and privacy. Consistently benchmarked as the fastest public resolver globally.
  • Privacy: No logging of client IP addresses; all logs purged within 24 hours; independently audited annually.
  • Extras: 1.1.1.2 (malware blocking), 1.1.1.3 (malware + adult content blocking), WARP VPN integration on mobile.

Google Public DNS — 8.8.8.8

  • Primary: 8.8.8.8  |  Secondary: 8.8.4.4
  • IPv6: 2001:4860:4860::8888 / 2001:4860:4860::8844
  • Best for: Reliability and compatibility. The most widely used public DNS in the world.
  • Privacy: Temporary logs retained for 24–48 hours; permanent logs anonymized. Google's privacy policy applies.
  • Extras: Supports DNS-over-HTTPS and DNS-over-TLS. Excellent documentation.

Quad9 — 9.9.9.9

  • Primary: 9.9.9.9  |  Secondary: 149.112.112.112
  • IPv6: 2620:fe::fe / 2620:fe::9
  • Best for: Security-conscious users. Blocks malicious domains using threat intelligence from 25+ sources.
  • Privacy: Swiss-based non-profit; no personally identifiable information logged; GDPR compliant.
  • Extras: 9.9.9.10 (no malware blocking, for users who want speed only). Supports DNSSEC validation.

OpenDNS — 208.67.222.222

  • Primary: 208.67.222.222  |  Secondary: 208.67.220.220
  • Best for: Customizable content filtering for families and organizations.
  • Extras: FamilyShield (208.67.222.123) pre-blocks adult content with no configuration needed.

How to Change DNS on Windows 11

Windows 11 has built-in DNS-over-HTTPS support, making it the easiest Windows version for configuring secure DNS:

  1. Open Settings (press Win + I).
  2. Navigate to Network & Internet → Wi-Fi (or Ethernet if you're wired).
  3. Click the name of your connected network (e.g., your Wi-Fi SSID) or click Hardware properties.
  4. Next to DNS server assignment, click Edit.
  5. Change the dropdown from Automatic (DHCP) to Manual.
  6. Toggle IPv4 on.
  7. In Preferred DNS, enter 1.1.1.1 (or your chosen DNS).
  8. In Alternate DNS, enter 1.0.0.1.
  9. Under each DNS field, set DNS over HTTPS to On (automatic template) if you want encrypted queries.
  10. Optionally toggle IPv6 on and enter 2606:4700:4700::1111 and 2606:4700:4700::1001.
  11. Click Save.

The change takes effect immediately — no restart required. To confirm, open Command Prompt and run nslookup example.com. The "Server" line should show your new DNS address.

How to Change DNS on Windows 10

Windows 10 does not have a built-in GUI for DNS-over-HTTPS, but changing the DNS server itself is straightforward:

  1. Open Settings → Network & Internet → Status.
  2. Click Change adapter options (or search "Network Connections" in the Start menu).
  3. Right-click your active connection (Wi-Fi or Ethernet) and select Properties.
  4. Select Internet Protocol Version 4 (TCP/IPv4) and click Properties.
  5. Select Use the following DNS server addresses.
  6. Enter 1.1.1.1 as the Preferred DNS server and 1.0.0.1 as the Alternate DNS server.
  7. Click OK, then Close.
  8. Optionally repeat with Internet Protocol Version 6 (TCP/IPv6) using the IPv6 addresses.

After saving, flush your DNS cache by opening Command Prompt as Administrator and running ipconfig /flushdns. This clears stale entries so your system starts using the new server immediately.

How to Change DNS on macOS

macOS (Ventura, Sonoma, Sequoia, and later) uses System Settings with a redesigned interface:

  1. Open System Settings (Apple menu → System Settings).
  2. Click Network in the sidebar, then select Wi-Fi (or Ethernet).
  3. Click Details… next to your connected network.
  4. Click the DNS tab.
  5. Click the − (minus) button to remove any existing DNS servers assigned by DHCP.
  6. Click the + (plus) button and add 1.1.1.1.
  7. Click + again and add 1.0.0.1.
  8. Click OK, then Apply.

To verify, open Terminal and run:

  • scutil --dns — Shows the DNS configuration for each network interface.
  • nslookup example.com — Confirms which server is answering queries.

On older macOS versions (Monterey and earlier), the path is System Preferences → Network → Advanced → DNS. The same add/remove buttons apply.

How to Change DNS on Linux

Linux DNS configuration varies by distribution and network management tool. Here are the most common methods:

Method 1: NetworkManager (Ubuntu, Fedora, Mint, Pop!_OS)

Most desktop Linux distributions use NetworkManager:

  1. Open Settings → Network (or Wi-Fi).
  2. Click the gear icon next to your active connection.
  3. Go to the IPv4 tab.
  4. Change Method to Automatic (DHCP) addresses only (this tells the system to get its IP from DHCP but use your manual DNS).
  5. In the DNS field, enter 1.1.1.1, 1.0.0.1 (comma-separated).
  6. Click Apply and reconnect.

Alternatively, use the command line:

  • nmcli con mod "Your Connection" ipv4.dns "1.1.1.1 1.0.0.1"
  • nmcli con mod "Your Connection" ipv4.ignore-auto-dns yes
  • nmcli con down "Your Connection" && nmcli con up "Your Connection"

Method 2: systemd-resolved (Ubuntu 18.04+)

Ubuntu and other systemd-based distros use systemd-resolved for DNS. To change the DNS server:

  1. Edit the resolved configuration: sudo nano /etc/systemd/resolved.conf
  2. Under the [Resolve] section, add or modify: DNS=1.1.1.1 1.0.0.1
  3. Optionally set: DNSOverTLS=yes to enable encrypted DNS.
  4. Save and restart the service: sudo systemctl restart systemd-resolved
  5. Verify with: resolvectl status

Method 3: Direct /etc/resolv.conf (servers, minimal installs)

On systems without NetworkManager or systemd-resolved, edit /etc/resolv.conf directly:

  • sudo nano /etc/resolv.conf
  • Replace or add: nameserver 1.1.1.1 and nameserver 1.0.0.1

Note: On many modern distributions, /etc/resolv.conf is managed by NetworkManager or systemd-resolved and will be overwritten. Use the methods above for a persistent change, or make the file immutable with sudo chattr +i /etc/resolv.conf (not recommended long-term).

How to Change DNS on Your Router

Changing DNS at the router level is the most powerful approach because every device on your network — laptops, phones, smart TVs, game consoles, IoT devices — will automatically use the new DNS servers without any per-device configuration.

  1. Open a browser and navigate to your router's admin panel. Common addresses are 192.168.1.1, 192.168.0.1, or 10.0.0.1. Check the sticker on the back of your router if unsure.
  2. Log in with your admin credentials (default is often admin/admin or admin/password — check the router's manual or sticker).
  3. Navigate to the WAN, Internet, or DHCP settings section. The exact location varies by router brand:
    • TP-Link: Advanced → Network → Internet (or DHCP Server)
    • ASUS: WAN → Internet Connection → WAN DNS Setting
    • Netgear: Internet (under Basic or Advanced)
    • Linksys: Connectivity → Internet Settings
  4. Find the DNS server fields (usually labeled "Primary DNS" and "Secondary DNS").
  5. Enter 1.1.1.1 as the primary and 1.0.0.1 as the secondary (or whichever provider you chose).
  6. Save the settings. The router may reboot.
  7. On each device, you may need to disconnect and reconnect to Wi-Fi (or run ipconfig /release then ipconfig /renew on Windows) for the new DNS to take effect via DHCP.

Keep in mind that individual devices with manually configured DNS will override the router setting. If you want absolute control, set the DNS on the router and leave each device's DNS on "Automatic."

How to Change DNS on iPhone and iPad

iOS allows per-network DNS configuration, but changes apply only to the specific Wi-Fi network you configure:

  1. Open Settings → Wi-Fi.
  2. Tap the ⓘ (info) icon next to your connected network.
  3. Scroll down to DNS and tap Configure DNS.
  4. Switch from Automatic to Manual.
  5. Remove existing DNS servers by tapping the red minus icons.
  6. Tap Add Server and enter 1.1.1.1.
  7. Tap Add Server again and enter 1.0.0.1.
  8. Tap Save.

For system-wide DNS (including cellular), install the 1.1.1.1: Faster Internet app from Cloudflare, which configures a local VPN profile that routes all DNS queries through Cloudflare. Alternatively, go to Settings → General → VPN & Device Management and install a DNS profile from your chosen provider.

How to Change DNS on Android

Android 9 (Pie) and later support Private DNS, which uses DNS-over-TLS for encrypted queries system-wide:

  1. Open Settings → Network & Internet (or Connections on Samsung).
  2. Tap Private DNS (you may need to tap More connection settings or Advanced first).
  3. Select Private DNS provider hostname.
  4. Enter the hostname for your provider:
    • Cloudflare: one.one.one.one
    • Google: dns.google
    • Quad9: dns.quad9.net
  5. Tap Save.

This setting applies to all connections — Wi-Fi and cellular — and persists across reboots. For older Android versions (8 and below), you must change DNS per Wi-Fi network: long-press the network → Modify → Advanced options → change IP settings to Static → enter DNS addresses.

How to Enable DNS-over-HTTPS in Your Browser

Even if you don't change your system DNS, you can configure your browser to use encrypted DNS independently. This protects browsing DNS queries while leaving other system DNS traffic unchanged.

Google Chrome

  1. Open Chrome and go to chrome://settings/security.
  2. Scroll to Use secure DNS and toggle it on.
  3. Select With: Cloudflare (1.1.1.1) or choose Custom and enter a DoH URL like https://dns.cloudflare.com/dns-query.

Mozilla Firefox

  1. Open Firefox Settings → search for DNS.
  2. Under DNS over HTTPS, set the protection level to Max Protection (all DNS via DoH) or Increased Protection (DoH with fallback).
  3. Choose a provider (Cloudflare is the default) or enter a custom URL.

Microsoft Edge

  1. Go to edge://settings/privacy.
  2. Scroll to Use secure DNS and toggle it on.
  3. Select a provider or enter a custom DoH URL.

Browser-level DoH is a quick win for privacy, but it only protects DNS queries made by the browser. System-level DNS changes or router-level changes protect all traffic from all applications.

How to Verify Your DNS Server Has Changed

After making changes, it's important to verify that your queries are actually going to the new DNS server. Here are several methods:

Command-Line Verification

  • Windows: Open Command Prompt and run nslookup example.com. The first two lines show the DNS server name and IP address that answered the query.
  • macOS: Open Terminal and run scutil --dns | head -20 to see configured DNS servers, or nslookup example.com to see which server answered.
  • Linux: Run resolvectl status (systemd) or cat /etc/resolv.conf to see configured nameservers, then nslookup example.com to confirm.

Online Verification

Visit dnsleaktest.com and click Standard test. The results show which DNS servers your queries are reaching. If you see your chosen provider (Cloudflare, Google, etc.) instead of your ISP, the change is working correctly.

You can also use our DNS Lookup tool to query specific record types and see the authoritative answer for any domain — useful for confirming DNS propagation after a change.

DNS Performance: ISP vs. Public DNS

How much difference does changing DNS actually make? The answer depends on your ISP and location, but here are typical benchmarks from independent testing:

  • Cloudflare 1.1.1.1: Average response time of 11–14 ms globally. Fastest in North America, Europe, and Asia-Pacific regions.
  • Google 8.8.8.8: Average response time of 15–25 ms. Extremely consistent and reliable, with the largest network of anycast servers.
  • Quad9 9.9.9.9: Average response time of 18–30 ms. Slightly slower due to threat intelligence processing, but the security benefit is worth the trade-off for most users.
  • Typical ISP DNS: Average response time of 30–80 ms. Performance varies wildly by provider and time of day. Some ISPs perform well; many don't.

A 20–50 ms improvement per DNS lookup may sound small, but consider that loading a single web page often triggers 30–100 DNS lookups (for the main domain, CDN subdomains, analytics, ads, fonts, API endpoints, etc.). Cumulatively, faster DNS can shave 0.5–2 seconds off complex page loads.

To benchmark DNS servers from your specific location, use the DNS Benchmark tool (Windows) by Gibson Research Corporation, or namebench (cross-platform). These tools test multiple DNS servers from your network and recommend the fastest one.

Troubleshooting After Changing DNS

If you experience issues after switching DNS servers, work through these steps:

Websites Not Loading After the Change

  • Flush your DNS cache — Old entries may conflict with the new server. On Windows: ipconfig /flushdns. On macOS: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder. On Linux: sudo systemd-resolve --flush-caches.
  • Check for typos — A mistyped DNS address (e.g., 1.1.1.11 instead of 1.1.1.1) will cause resolution failures.
  • Test with ping 1.1.1.1 — If the ping fails, your network connectivity itself is the issue, not DNS.
  • Revert and test — Switch back to "Automatic (DHCP)" to confirm the problem is related to your DNS change, not a coincidental outage.

DNS-over-HTTPS Not Working

  • Ensure your OS or browser supports DoH with the provider you chose. Not all DNS servers support DoH.
  • Some corporate networks and school Wi-Fi block DoH to maintain content filtering. If DoH fails, try standard (unencrypted) DNS first to confirm basic resolution works.
  • On Windows 11, DoH only works with DNS servers that Microsoft has whitelisted (1.1.1.1, 8.8.8.8, 9.9.9.9, and a few others). Custom DoH URLs may require registry edits.

Some Devices Still Using Old DNS

If you changed DNS on your router but some devices still resolve through the old server, those devices may have a manually configured DNS that overrides DHCP. Check each device's network settings and ensure DNS is set to "Automatic" so it picks up the router's configuration. Also, devices may cache the old DHCP lease — disconnect and reconnect to Wi-Fi, or renew the DHCP lease manually.

Advanced: DNS-over-HTTPS vs. DNS-over-TLS

Both DoH and DoT encrypt your DNS queries, but they work differently:

  • DNS-over-HTTPS (DoH) uses port 443 (standard HTTPS). Because it blends in with normal web traffic, it's harder for network administrators to block. Supported by browsers, Windows 11, macOS, iOS, and Android.
  • DNS-over-TLS (DoT) uses a dedicated port (853). It's easier for firewalls to identify and block, but it's more transparent and doesn't mix DNS with web traffic. Android's "Private DNS" feature uses DoT natively.

For most users, DoH is the better choice because it works everywhere HTTPS works and is supported by the widest range of devices and software. DoT is preferred in environments where administrators want to separate DNS traffic for monitoring and policy purposes.

For a deeper understanding of how DNS works, including record types, caching, and propagation, read our What Is DNS? guide.

Frequently Asked Questions

What is a DNS server and why would I change it?

A DNS server translates domain names (like example.com) into IP addresses that computers use to communicate. You would change it to improve speed, boost privacy, add security filtering, or fix DNS errors. Public DNS servers like Cloudflare (1.1.1.1), Google (8.8.8.8), and Quad9 (9.9.9.9) are faster and more reliable than most ISP defaults.

What is the best DNS server to use?

It depends on your priorities. Cloudflare 1.1.1.1 is the fastest and most privacy-focused. Google 8.8.8.8 offers unmatched reliability and global reach. Quad9 9.9.9.9 adds built-in malware and phishing blocking. For families, Cloudflare 1.1.1.3 and OpenDNS FamilyShield block adult content automatically.

How do I change DNS on Windows 11?

Open Settings → Network & Internet → Wi-Fi (or Ethernet) → your connection → DNS server assignment → Edit. Switch to Manual, enable IPv4, enter your preferred DNS (e.g., 1.1.1.1) and alternate DNS (e.g., 1.0.0.1). Optionally enable DNS over HTTPS. Click Save.

How do I change DNS on macOS?

Go to System Settings → Network → Wi-Fi (or Ethernet) → Details → DNS. Remove existing servers with the minus button, then add your new DNS servers (e.g., 1.1.1.1 and 1.0.0.1) with the plus button. Click OK, then Apply. Verify with scutil --dns in Terminal.

Can I change DNS on my router so all devices use it?

Yes. Log into your router's admin panel (usually at 192.168.1.1 or 192.168.0.1), find the WAN or DHCP DNS settings, and enter your preferred DNS addresses. All devices that receive DNS settings via DHCP will automatically use the new servers. This is the most efficient method for an entire household.

What is DNS-over-HTTPS and should I use it?

DNS-over-HTTPS (DoH) encrypts your DNS queries inside HTTPS traffic, preventing ISPs and attackers from seeing which domains you're resolving. Yes, you should use it if privacy matters to you. Windows 11, macOS, iOS, Android, Chrome, Firefox, and Edge all support DoH natively.

How do I verify that my DNS server has been changed?

Run nslookup example.com in a terminal — the output shows which DNS server answered. You can also visit dnsleaktest.com and run a standard test to confirm queries are going to your chosen provider. On Windows, ipconfig /all lists the DNS servers for each adapter.

Will changing DNS speed up my internet?

Changing DNS can speed up the initial connection to websites by reducing DNS lookup time, but it does not increase your raw download or upload bandwidth. The improvement is most noticeable when switching from a slow ISP DNS to a fast public resolver like 1.1.1.1, which can shave 20–50 ms off every page load.