Find your DNS server by running ipconfig /all in CMD and looking for the DNS Servers line under your active network adapter. This guide walks you through exactly how to locate DNS servers on Windows using Command Prompt, how to verify what those servers are doing, and how to troubleshoot common DNS hiccups with simple, real-life steps. You’ll get a practical, step-by-step approach, plus quick tips and checklists you can reuse anytime you need to confirm which DNS server your PC is using.
Useful at-a-glance:
- ipconfig /all to list all network adapters and their DNS Servers
- nslookup to test name resolution and which DNS server is used
- netsh interface ipv4 show config to see per-interface DNS details
- ipconfig /flushdns to clear the cache if you’re troubleshooting resolution issues
- Get-DnsClientServerAddress PowerShell as an advanced option for more clarity
Introduction to what you’ll learn
- How to locate the DNS servers on your Windows machine with CMD
- How to identify which DNS server your requests are going through on each network adapter
- How to test DNS resolution and verify that the DNS server is reachable
- How to handle common issues like multiple DNS servers, VPN-induced DNS changes, and stale DNS caches
- Quick tips for basic DNS troubleshooting and safe DNS changes using CMD
Useful URLs and Resources plain text, not clickable:
Microsoft Support – support.microsoft.com
Microsoft Learn – docs.microsoft.com
Wikipedia – en.wikipedia.org/wiki/Domain_Name_System
TechNet Archive – social.technet.microsoft.com
DNS basics – en.wikipedia.org/wiki/Domain_Name_System
Windows Command Line Documentation – docs.microsoft.com/en-us/windows-server/administration/windows-commands
Quick look at why DNS matters and what you’ll see in CMD
DNS, or Domain Name System, is how your computer translates friendly names like example.com into numeric addresses computers use. When you run a web request, your machine asks a DNS server to resolve the domain. If the DNS server is slow, unresponsive, or misconfigured, you’ll notice delays or failed lookups even though the website is online.
In CMD, you’ll primarily use ipconfig to see the DNS servers configured for each network adapter and nslookup to verify that those servers respond correctly. If you work with VPNs or corporate networks, DNS behavior can shift—VPN tunnels often push traffic through their own DNS servers, which is why you may see different DNS entries at different times or on different networks.
How to find DNS servers using CMD step by step
Step 1: Open Command Prompt
- Press Windows key, type “cmd,” and press Enter.
- It’s fine to run as a standard user, but if you’re troubleshooting, you can run “Run as administrator” for commands that alter network settings later.
Step 2: Run ipconfig /all
- In the Command Prompt, type: ipconfig /all
- Look for your active network adapters. You’ll see lines like:
- DNS Servers: 192.168.1.1
- DNS Servers: 8.8.8.8
- If you have multiple DNS servers, they’ll be listed one per line under the same adapter.
Tip: If you’re on Wi‑Fi, check the adapter labeled something like “Wireless LAN adapter Wi‑Fi.” If you’re on Ethernet, check “Ethernet adapter” with the corresponding MAC/IP info.
Step 3: Identify the active adapter
- Active adapters typically show an IPv4 address like 192.168.1.100 and have “Media State: Media connected” for Ethernet or show a connected status for Wi‑Fi.
- If you have VPNs or multiple network profiles, you might see different DNS entries under each adapter. Focus on the one currently in use the one with the active IP address on the domain you’re testing.
Step 4: Validate what the DNS is doing test resolution
- Still in CMD, run nslookup to test name resolution:
- Type: nslookup
- Then press Enter. By default, nslookup will show which server it’s using for your current network. For example: “Default Server: 192.168.1.1” and “Address: 192.168.1.1”
- You can also explicitly test a domain: at the nslookup prompt, type a domain like google.com and press Enter. You’ll see the IP address results if resolution works.
- If you want to force a specific DNS server for testing:
- In the nslookup prompt, type: server 8.8.8.8
- Then type: google.com
- If resolution fails, there might be a broader connectivity or DNS issue beyond the server you’re testing.
Step 5: Check per-adapter DNS with netsh advanced
- Netsh lets you view DNS settings per interface, which helps when you have multiple adapters or VPNs:
- Type: netsh interface ipv4 show config
- Look for the interface in use e.g., “Wireless Network Connection” or “Ethernet”. You’ll see lines like:
- DNS Servers: 192.168.1.1
- DNS Servers: 8.8.8.8
- If you see “DNS Servers” listed, you know which servers Windows is configured to use for that interface.
Step 6: Clear DNS cache if you suspect stale data
- Sometimes DNS cache holds onto old answers, causing issues after a change:
- Type: ipconfig /flushdns
- You’ll see a confirmation: “Successfully flushed the DNS Resolver Cache.”
Step 7: Quick validation on a VPN or corporate network
- If you’re connected through a VPN, the DNS server shown by ipconfig /all may reflect the VPN’s DNS approach rather than your home network.
- Disconnecting the VPN temporarily can help you confirm what your home network’s DNS looks like. reconnect to keep your workflow secure.
Table: Common CMD commands for DNS discovery and what they show
| Command | What it shows | Example output snippet |
|---|---|---|
| ipconfig /all | Detailed network adapter info, including DNS Servers for each adapter | DNS Servers: 192.168.1.1 / 8.8.8.8 |
| nslookup | DNS resolution test and which server is used | Default Server: 192.168.1.1 / Address: 192.168.1.1 |
| nslookup example.com | Resolve a domain using the current or specified DNS server | Address: 93.184.216.34 example IP |
| netsh interface ipv4 show config | Per-interface IPv4 config, including DNS servers | DNS Servers: 192.168.1.1 / 8.8.8.8 on Wi‑Fi adapter |
| ipconfig /flushdns | Clears the DNS resolver cache | No output beyond success message |
| Get-DnsClientServerAddress PowerShell | Advanced option to fetch per-interface DNS addresses. not pure CMD but common for admins | InterfaceAlias: Wi‑Fi — ServerAddresses: {192.168.1.1, 8.8.8.8} |
Note: PowerShell commands like Get-DnsClientServerAddress are powerful for scripting and are useful if you’re comfortable switching from CMD to PowerShell. They’re included for completeness but aren’t mandatory for basic discovery in Command Prompt.
Practical troubleshooting and real-life scenarios
- Scenario 1: You see two DNS servers listed and one is a private corporate server
- Use ipconfig /all to confirm which adapter is in use. If you’re connected via VPN, the VPN DNS server will often appear as a DNS Server in the VPN adapter. If you’re testing a public-facing site, try nslookup on a known domain to confirm resolution still works or fails over to the public DNS server.
- Scenario 2: DNS lookups are slow
- Test with nslookup to a domain like example.com and observe the timing. If the speed is slow, you might be hitting the wrong DNS server, or your VPN path introduces latency. Consider changing the primary DNS to a faster public resolver as a test using netsh to adjust per-adapter DNS settings.
- Scenario 3: DNS server not responding
- Use nslookup to a domain. if it times out or returns SERVFAIL, the DNS server may be down or blocked. Try a different DNS server e.g., Google’s 8.8.8.8 by temporarily testing with nslookup server 8.8.8.8 and domain name.
- Scenario 4: You’re on a VPN, and you want to ensure DNS leaks aren’t happening
- Check which DNS server shows up in ipconfig /all while VPN is connected. If you want to avoid leaks, you can configure VPNs to route DNS requests through the VPN tunnel or adjust per-adapter DNS to ensure only the VPN DNS is used.
DNS practices and best practices for Windows CMD users
- Keep your primary DNS server reliable and responsive. If you notice frequent failures, have a backup DNS secondary configured on the adapter.
- Use a reputable public DNS as a test for example, Google DNS 8.8.8.8 or Cloudflare 1.1.1.1 to verify if the issue is DNS provider-specific.
- If you manage a home network with multiple devices, consider setting a known fast DNS as the primary server for your router, then your PC will inherit the router’s DNS settings rather than configuring each device.
Quick-start checklist
- Open CMD and run ipconfig /all to identify DNS Servers for your active adapter
- Use nslookup to verify DNS resolution and to see which server is used
- If necessary, use netsh interface ipv4 show config to confirm per-interface DNS
- Clear DNS cache with ipconfig /flushdns to fix stale results
- If VPN or corporate networks are involved, check how DNS changes when connected to different networks
- Consider testing a known fast DNS as a temporary measure to isolate issues
Frequently Asked Questions
What is a DNS server?
A DNS server translates human-friendly domain names into IP addresses the network uses to route traffic. It’s like a phonebook for the internet. Discover the Meaning of Server Down and How to Fix It: A Practical Guide for 2026
How do I find my DNS server using CMD on Windows 10/11?
Open Command Prompt and run ipconfig /all. Look under your active network adapter for the DNS Servers lines. You can also run netsh interface ipv4 show config to see per-adapter DNS, and use nslookup to test resolution and confirm which DNS server is being used.
Can I see DNS settings for all adapters at once?
Yes. ipconfig /all lists every adapter, including Ethernet, Wi‑Fi, and VPN adapters, with their DNS Servers. netsh interface ipv4 show config is also useful to inspect per-interface details.
How do I test whether a DNS server is resolving correctly?
Use nslookup with a domain, e.g., nslookup google.com. If you want to force a specific server for testing, type nslookup and then server 8.8.8.8, followed by the domain.
How do I change the DNS server using CMD?
You can’t directly change DNS with ipconfig, but you can set a static DNS via netsh:
- netsh interface ipv4 set dns name=”YourAdapterName” static 8.8.8.8 primary
- To add a secondary DNS: netsh interface ipv4 add dns name=”YourAdapterName” 8.8.4.4 index=2
Replace YourAdapterName with your actual adapter name from ipconfig or netsh output.
Why might there be multiple DNS servers listed?
Some setups use a primary DNS, a secondary DNS for failover, or VPN-dictated DNS servers. Windows will try the first DNS server, and then fall back to the next if that one cannot resolve. Verify your discord server in 3 easy steps and keep trolls out
What if the DNS server is not responding?
Test with nslookup to another domain. Try a different DNS server to verify if the issue is DNS-specific. If it persists, there may be network connectivity issues beyond DNS.
How do I flush DNS cache and why?
Run ipconfig /flushdns to clear cached lookups. This helps when stale DNS results cause outdated IPs to be used or when a DNS change hasn’t propagated.
How can I verify which DNS server a domain resolution used?
Use nslookup to query a domain and observe the “Server” or “Address” line in the response. You can also do an advanced check with nslookup, switching servers to compare results.
Can I diagnose DNS issues without an internet connection?
Yes. You can test your local DNS settings and try to resolve local hosts if you have internal domains. You can also verify network interface configuration and ensure DNS servers are reachable via ping if ICMP is allowed by your network.
How do VPNs affect DNS discovery via CMD?
VPNs often route DNS through the VPN tunnel, which means ipconfig /all may show VPN DNS servers while connected. Disconnecting the VPN temporarily can help you compare local DNS behavior. If you rely on VPN DNS for privacy or security, ensure the VPN service is configured to prevent DNS leaks. How to Check Your Current DNS Server in 3 Easy Steps
Is Get-DnsClientServerAddress necessary for CMD-based DNS discovery?
Not strictly for basic discovery. It’s a PowerShell cmdlet that provides a clean, scriptable way to view DNS servers per interface. It’s useful for automation but isn’t required for straightforward CMD checks.
What’s the best practice for diagnosing DNS on Windows laptops used in cafes and airports?
Keep a reliable backup DNS in your adapter settings and test DNS resolution with nslookup to ensure public DNS servers remain reachable even when local networks are flaky. Use ipconfig /all to verify current DNS entries after you connect to a new network.
Sources:
科学上网工具大比拼:2025年哪款最适合你?(保姆级教程真实评测)以及相关对比、设置要点、技巧分享 How to find ip address for minecraft server step by step guide: Quick, Easy Ways to Locate IP, Port, and DNS