Other

How to Change DNS Servers in Windows, macOS, and Linux

This guide provides detailed instructions on changing DNS servers on computers running Windows, macOS, and Linux. You'll learn how to improve internet speed, bypass blocks, and protect yourself using public DNS.

Updated at February 16, 2026
5-10 min
Easy
FixPedia Team
Применимо к:Windows 10/11macOS 12+Ubuntu 20.04+

Introduction

DNS (Domain Name System) is the "phonebook" of the internet, converting domain names into IP addresses. Switching to public DNS servers, such as Google DNS (8.8.8.8) or Cloudflare DNS (1.1.1.1), can significantly speed up website loading, bypass geographic restrictions, and enhance security by filtering malicious domains. In this guide, you'll find step-by-step instructions for popular operating systems: Windows, macOS, and Linux.

Requirements

Before you begin, ensure you have:

  • A computer running Windows 10/11, macOS 12+, or Linux (Ubuntu 20.04+ or other distributions with systemd-resolved/Netplan).
  • Administrator privileges (required on Windows and Linux to change network settings).
  • A stable internet connection for initial setup.
  • Basic skills in using the terminal or control panel.

Step-by-Step Instructions

For Windows 10/11

  1. Open Network Settings: Press Win + R, type ncpa.cpl, and press Enter. A window with network adapters will open.
  2. Select the active connection: Right-click on Ethernet or Wi-Fi (with a green arrow) and choose Properties.
  3. Locate IPv4 settings: In the list of components, select Internet Protocol Version 4 (TCP/IPv4) and click Properties.
  4. Specify DNS addresses:
    • Check Use the following DNS server addresses.
    • In the Preferred DNS server field, enter 8.8.8.8 (Google) or 1.1.1.1 (Cloudflare).
    • In the Alternate DNS server field, enter 8.8.4.4 or 1.0.0.1 respectively.
  5. Save changes: Click OK in all windows. To apply immediately, restart the adapter: in the same ncpa.cpl window, disable and re-enable the connection, or restart your computer.

💡 Tip: If you're using DHCP, ensure the "Obtain DNS server address automatically" option is unchecked; otherwise, your settings may be overwritten.

For macOS 12 Monterey and Later

  1. Open System SettingsNetwork.
  2. Select the active interface: On the left, choose Wi-Fi or Ethernet (with a green dot).
  3. Click "Details" in the bottom-right corner.
  4. Go to the "DNS" tab.
  5. Add DNS servers: Click the + button and enter the addresses, for example:
    1.1.1.1
    1.0.0.1
    
    For Google DNS, add 8.8.8.8 and 8.8.4.4.
  6. Apply changes: Click OK, then Apply in the main network window. Settings take effect immediately.

⚠️ Important: If you use multiple network interfaces (e.g., Wi-Fi and Ethernet), configure DNS for each one separately.

For Linux (Ubuntu 20.04+ with Netplan)

  1. Identify the network interface name: Open the terminal (Ctrl+Alt+T) and run:
    ip a
    
    Find your interface, e.g., eth0 (wired) or wlan0 (wireless).
  2. Edit the Netplan configuration: Files are typically located in /etc/netplan/. Open it with an editor (e.g., sudo nano /etc/netplan/01-netcfg.yaml).
  3. Add DNS servers: In your interface's section (e.g., eth0), add a nameservers block:
    network:
      version: 2
      ethernets:
        eth0:
          dhcp4: true
          nameservers:
            addresses: [8.8.8.8, 8.8.4.4]
    
    Replace eth0 with your interface and specify the desired addresses.
  4. Apply the configuration:
    sudo netplan apply
    
  5. Verify the settings:
    systemd-resolve --status | grep 'DNS Servers'
    
    Or check /etc/resolv.conf (it should contain the specified addresses).

For Linux with systemd-resolved (Other Distributions, e.g., Fedora)

  1. Edit the resolved.conf file:
    sudo nano /etc/systemd/resolved.conf
    
  2. Uncomment and modify the lines:
    [Resolve]
    DNS=8.8.8.8 8.8.4.4
    FallbackDNS=1.1.1.1 1.0.0.1
    
  3. Restart the service:
    sudo systemctl restart systemd-resolved
    
  4. Ensure /etc/resolv.conf points to the correct DNS:
    ls -l /etc/resolv.conf
    
    It should point to /run/systemd/resolve/stub-resolv.conf or similar.

Verifying the Result

After configuration, confirm that the DNS servers have changed:

  • Windows: In the command prompt (run as administrator):
    ipconfig /all
    
    In your adapter's section, look for "DNS Servers"—they should show the addresses you specified.
  • macOS/Linux: In the terminal:
    cat /etc/resolv.conf
    
    Or for systemd:
    systemd-resolve --status
    
    Look for "DNS Servers" in the output.

Also, test your internet connection: open a few websites that were previously slow or blocked. For precise diagnostics, use nslookup example.com (Windows) or dig example.com (macOS/Linux)—the response should display the new DNS server.

Potential Issues

  • "Access denied" or "Administrator privileges required": On Windows and Linux, run the editor or terminal as administrator. On macOS, you may need to enter your password when changing network settings.
  • No internet after changing DNS: Check that the addresses are entered correctly (no spaces, separated by commas). Try other public DNS servers, like 9.9.9.9 (Quad9). Ensure you've configured both IPv4 and IPv6 settings correctly if applicable.
  • Settings don't persist after reboot (Linux): If /etc/resolv.conf gets overwritten, use Netplan or systemd-resolved instead of manual editing. Ensure the systemd-resolved service is active.
  • Sites don't resolve, but pinging IPs works: The issue is specifically with DNS. Check if your DNS provider is blocking anything. Temporarily disable your firewall or antivirus to test.
  • Slow performance even after changing DNS: The problem might be with routing or the internet connection itself. Check speed using speedtest-cli or similar tools. Try other DNS servers closer to your region.

If the problem persists, revert to your old DNS addresses (usually automatically obtained from your router) and contact your internet service provider.

F.A.Q.

What is DNS and why should I change it?
How to check current DNS servers?
Do I need to restart my computer after changing DNS?
Which public DNS do you recommend?

Hints

Identify current DNS servers
Select public DNS servers
Change DNS settings in OS network parameters
Verify new DNS application
FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community