First, open Settings by pressing Windows+i on your keyboard. You can also right-click the Start button and select “Settings” in the menu that appears.

In Settings, select “Network & Internet” in the sidebar.

In Network & Internet settings, locate the name of the internet connection you want to change the DNS servers for in the list (such as “Wi-Fi” or “Ethernet”) and click it.

On the properties page for that network connection, choose “Hardware Properties.”

Next, find “DNS Server Assignment” and click the “Edit” button beside it.

An “Edit DNS Settings” window will pop up. Using the drop-down menu, select “Manual.” Then switch on IPv4 or IPv6 depending on which type of IP connection you want to modify. Most connections still use IPv4 by default, but some ISPs require IPv6 as well.

Below the IPv4 or IPv6 headings, enter the primary DNS server address in the “Preferred DNS” box (such as “8.8.8.8” and “8.8.4.4” for Google’s free DNS service). Below that, enter the secondary DNS server address in the “Alternate DNS” box.

If you’d like to use DNS over HTTPS, which encrypts your DNS requests for improved privacy and security, set both “Preferred DNS Encryption” and “Alternate DNS Encryption” to “Encrypted Only (DNS over HTTPS)” using the drop-down boxes below the DNS addresses you entered in the last step. Repeat this for either IPv4 or IPv6 if necessary.

If you don’t know if your new DNS servers support encryption, it’s OK to leave DNS encryption set to “Unencrypted Only.” When you’re done, click “Save,” and the pop-up window will close.

On the Wi-Fi or Ethernet hardware properties page, you’ll see the DNS servers you just entered listed with their encryption status beside them.

Close the Settings app, and you’re good to go. From now on, all of the internet traffic that goes through the network adapter you modified will use the new DNS servers. If necessary, you can repeat these steps with an alternate network adapter (such as Ethernet if you’ve already set up DNS address for Wi-Fi).