LookMyIPLookMyIP
Blog/How to Change Your DNS Server on Windows, Mac, Linux & Router
How-To7 min read

How to Change Your DNS Server on Windows, Mac, Linux & Router

By LookMyIP Editorial

Step-by-step instructions to change your DNS server to Google DNS, Cloudflare DNS, or OpenDNS on Windows, macOS, Linux, and at the router level.

Why Change Your DNS Server?

Your ISP provides a default DNS server, but switching to a third-party DNS can offer several benefits:

  • Speed: Public DNS servers like Cloudflare (1.1.1.1) and Google (8.8.8.8) are often faster than ISP DNS, reducing page load times.
  • Reliability: Major public DNS services have 100% uptime SLAs and global anycast networks. ISP DNS servers sometimes go down or become slow.
  • Privacy: Some DNS providers (like Cloudflare) commit to not selling your DNS queries and purge logs within 24 hours. ISP DNS may log and sell your browsing data.
  • Security: Services like Quad9 (9.9.9.9) automatically block known malicious domains. Cloudflare's 1.1.1.2 and 1.1.1.3 offer content filtering options.
  • Access: Some ISP DNS servers have stale caches or fail to resolve certain domains. Switching to a public DNS can fix these issues.

Change DNS on Windows 10/11

  1. Open Settings > Network & internet > Wi-Fi (or Ethernet).
  2. Click on your connected network.
  3. Click Edit next to DNS server assignment.
  4. Switch from "Automatic (DHCP)" to Manual.
  5. Toggle IPv4 on.
  6. Enter your preferred DNS server (e.g., 1.1.1.1) as Preferred DNS.
  7. Enter the secondary DNS (e.g., 1.0.0.1) as Alternate DNS.
  8. Optionally toggle IPv6 on and enter the IPv6 DNS addresses.
  9. Click Save.

Verify: Open Command Prompt and run nslookup google.com. The server shown should be your new DNS. Also check using LookMyIP's DNS Lookup tool to confirm queries are going through the expected resolver.

Change DNS on macOS

  1. Open System Settings (or System Preferences on older macOS).
  2. Click Network in the sidebar.
  3. Select your active connection (Wi-Fi or Ethernet).
  4. Click Details (or Advanced on older macOS).
  5. Click DNS in the sidebar.
  6. Click the + button to add DNS servers.
  7. Enter 1.1.1.1 and 1.0.0.1 (or your preferred DNS).
  8. Remove any existing DNS entries you don't want by selecting them and clicking -.
  9. Click OK, then Apply.

Flush DNS cache after changing: Open Terminal and run: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Verify: Run nslookup google.com in Terminal to confirm the new DNS is being used.

Change DNS on Linux

Using NetworkManager (Ubuntu, Fedora, etc.):

  1. Open Settings > Network > click the gear icon on your connection.
  2. Go to the IPv4 tab.
  3. Turn off "Automatic" for DNS and enter your DNS servers.
  4. Apply and reconnect.

Using the terminal (systemd-resolved):

  1. Edit /etc/systemd/resolved.conf:

sudo nano /etc/systemd/resolved.conf

  1. Set: DNS=1.1.1.1 1.0.0.1
  2. Restart the service: sudo systemctl restart systemd-resolved

Change DNS at the router level (recommended): Changing DNS on your router applies to every device on your network:

  1. Log into your router's admin panel (usually 192.168.1.1 or 192.168.0.1).
  2. Find DNS settings (often under WAN, Internet, or DHCP settings).
  3. Replace the ISP DNS servers with your preferred DNS (e.g., 1.1.1.1 and 1.0.0.1).
  4. Save and reboot the router.

This is the best approach because it protects all devices, including smart home devices and IoT devices that you can't configure individually.

Try It Yourself

Use LookMyIP's free tools to look up IP addresses, check DNS records, verify SSL certificates, and more.