How to change the DNS address in Windows 10 and 11

A digital depiction of boxes with DNS on them
(Image credit: Getty Images)

You might not think much about Domain Name Servers – or DNS for short – but you probably access them every day. These are the servers that work behind the scenes to translate familiar domain names (such as itpro.co.uk) into the numeric IP addresses used by the internet's backbone servers.

Normally these DNS lookups happen automatically, using servers operated by your ISP – but if you wish you can change your settings to use any available servers.

Why should I change my DNS?

Your ISP's name servers can normally provide a very fast response because they're connected to the same core network as your client devices. However, if the server is overloaded, or if its network connection is congested, you could still experience a slow service. If you're noticing that online sites and services are slow to load when you first enter their names then switching to a different name server could help. (Subsequent connections should be fast regardless of DNS performance because once your computer receives the addressing information it will cache it for future use.)

Another reason you might choose to change your DNS settings is security. It's theoretically possible for cybercriminals to hack into a poorly managed name server and change the addressing rules so that legitimate domain names are redirected to malicious sites. If you suspect your DNS might be vulnerable to such an attack, you can protect yourself by moving to a trusted server.

Some DNS operators also maintain lists of sites that are known to be harmful, and block attempts to connect to them. Switching to these servers provides you with instant protection against phishing scams and other online dangers.

Which DNS should I use?

Online devices usually have two DNS addresses configured, one primary and one secondary. If the primary DNS doesn't respond to a query in a reasonable amount of time, the device will automatically try the secondary one instead. If you're finding your regular DNS is slow, you can try swapping these around, so you're contacting the other server first.

Alternatively, you can replace your ISP's servers with a free public DNS. One of the simplest options is Google Public DNS, which promises a fast, robust service: to try it out, you simply need to configure 8.8.8.8 as your primary DNS address, and 8.8.4.4 as your secondary server (see below for details of how to do this).

Cloudflare is another company offering a free name service similar to Google's, using 1.1.1.1 and 1.0.0.1 as its primary and secondary servers. It also offers services with automatic malware blocking on 1.1.1.2 / 1.0.0.2, and adult content filtering on 1.1.1.3 / 1.0.0.3.

One of the most versatile DNS options is OpenDNS, operated by network specialist Cisco. It provides free DNS at IP addresses 208.67.222.222 and 208.67.220.220, and allows you to configure optional blocks on phishing, adult sites, and other content. For business networks, DNS-level security is also part of the Cisco Umbrella security platform.

How to change DNS settings in Windows 10

Network clients are usually configured to send DNS queries to the local internet router, which then takes care of forwarding them to the correct server. This approach means you can move your whole network onto a different domain name service by simply updating the DNS addresses in your router's management interface.

If you prefer though you can configure individual computers to use specific name servers. In Windows 10 this is easily done using either the Command Prompt or the Control Panel.

To do it via the Command Prompt, start by opening an elevated shell: a quick way to do this is by opening the Start menu, typing "cmd", then selecting Run as administrator, and accepting the security prompt that appears.

Once the Command Prompt window opens, enter the following command to see a list of network interfaces:

netsh interface show interface

A screenshot of the Windows 10 Command Prompt - command 'Netsh'

(Image credit: Future)

Make a note of the name of the network whose DNS settings you want to change (in our case it's "WiFi"). You can now configure this network to use whatever primary and secondary DNS servers by entering the two commands below – inserting the name of your own network interface between the quotation marks, and replacing x.x.x.x and y.y.y.y with the IP addresses of the primary and secondary DNS you want to use:

netsh interface ipv4 set dns name="Network Name" static x.x.x.x primary

netsh interface ipv4 add dns name="Network Name" y.y.y.y index=2

The change should instantly take effect. You can check your active DNS settings by entering:

netsh interface ipv4 showdnsservers

How to change DNS settings using the Control Panel

If you prefer to use a graphical interface to change your DNS settings, you can jump straight to the relevant page of the Control Panel by hitting the Start button and searching for "View Network Connections". Selecting this will bring up a window showing all configured networks, which might include Bluetooth and virtual network adaptors as well as Wi-Fi and Ethernet connections.

Now right-click on the network you want to configure and select Properties to open a window showing the various drivers and protocols used by that connection. Double-click on "Internet Protocol Version 4 (TCP/IPv4)" (or single-click it and hit the Properties button below) to open a new window showing your IPv4 address settings.

In the lower half of this window, click on "Use the following DNS server addresses", then enter your desired primary and secondary addresses into the relevant fields. Hit OK to close the window, then OK again on the main connection properties dialogue.

Your DNS will now be immediately updated, and you can close the Control Panel. If you want to go back to router-based DNS, just come back to this page and select "Obtain an IP address automatically".

How to change DNS settings in Windows 11

If you're fed up of controls and features changing between different versions of Windows, you'll be pleased to learn that the process for changing DNS settings in Windows 11 is precisely the same as in Windows 10.

That applies whether you're using the Command Prompt or the Control Panel – so you can follow our instructions above to set up your Windows 11 system in whatever way you like.

Darien Graham-Smith

Darien began his IT career in the 1990s as a systems engineer, later becoming an IT project manager. His formative experiences included upgrading a major multinational from token-ring networking to Ethernet, and migrating a travelling sales force from Windows 3.1 to Windows 95.

He subsequently spent some years acting as a one-man IT department for a small publishing company, before moving into journalism himself. He is now a regular contributor to IT Pro, specialising in networking and security, and serves as associate editor of PC Pro magazine with particular responsibility for business reviews and features.

You can email Darien at darien@pcpro.co.uk, or follow him on Twitter at @dariengs.