What’s My DNS Server - How to Find DNS Server in Windows Command Line
In this tutorial, we will learn how to find your DNS Server settings in Windows 10 using the netsh
or ipconfig
command. We will also look at how to use the nslookup command to find name servers for a domain.
To find DNS Server settings on Windows 10, run the following command on CMD or PowerShell:
netsh interface ipv4 show dnsservers
The above command displays DNS servers that have been configured for IPv4. To check IPv6 DNS settings, run the following command:
netsh interface ipv6 show dnsservers
If your PC has multiple network interfaces, you may find different DNS server addresses under each interface. You can run the following command to check which interfaces are currently active:
netsh interface show interface
Windows users can also use the ipconfig /all
command to find DNS Server Addresses:
ipconfig /all
You will see an output similar to the following:
How To Change DNS Settings in Windows 10/11.Using Nslookup Command to Find Nameservers for a Domain
If you want to find a nameserver for a domain name, then run the nslookup
command as follows (replace example.com
with the actual name of the domain you want to check):
nslookup -type=ns example.com
The command returns the name servers responsible for the domain name (under the answer section). The following is an example output of the nslookup command.
The -type=ns
tells nslookup to search for name servers responsible for that domain. You will see at least two name servers for every domain name.
A DNS server is a computer designated to translate domain names into IP addresses. When a user wants to access a website, Windows takes the domain name typed in and requests the IP address for that domain from the DNS server.
Also, note that Windows keeps a local DNS cache so that it does not have to contact the DNS server every time.