Three Windows PowerShell checks that answer different network questions
A Windows machine can have a working Ethernet link yet fail to resolve a hostname. It can resolve a name correctly and still fail to connect to the intended application port. It can reach one server over TCP while another client fails because the clients use different routes, firewall policies or identity contexts. Treating all these symptoms as a single “internet problem” wastes time and encourages disruptive fixes. A better approach separates local IP configuration, DNS resolution and a particular network connection into three testable questions.
The Windows NetTCPIP and DnsClient PowerShell modules provide useful commands for these layers: Get-NetIPConfiguration, Resolve-DnsName and Test-NetConnection. Microsoft documents each command and its parameters. They return different forms of evidence, so the result of one should not be interpreted as proof that the other two layers are healthy. The examples below are diagnostic, not requests to modify network settings, scan unrelated systems or disable security controls.
1. Start with Get-NetIPConfiguration
Get-NetIPConfiguration reports IP network configuration for interfaces, including addresses and DNS servers. The basic form examines connected nonvirtual interfaces; Microsoft’s documented -All option includes additional interfaces such as virtual and disconnected adapters. That distinction matters on laptops with VPNs, Hyper-V switches or disconnected wireless hardware. A configuration that appears reasonable on a physical adapter may be irrelevant if the affected application uses another interface or route.
Get-NetIPConfiguration
Get-NetIPConfiguration -All
Get-NetIPConfiguration -InterfaceAlias 'Ethernet'
Begin by looking for a usable address and prefix, the default gateway relevant to the destination, and the configured DNS servers. An automatically assigned address is not by itself evidence of working internet access. A default gateway is not proof that a route to the requested destination exists; a VPN may introduce more specific routes. If two connected adapters are present, note which one will carry traffic and whether its DNS configuration matches the intended network policy.
For a limited reproducible case, write down the interface alias, IP address, prefix, gateway and DNS servers before changing anything. Compare those facts with an expected configuration approved by the network team. Do not immediately reset the adapter merely because a symptom appears to involve the network. Preserve the initial state so that later tests can explain what changed and whether the corrective action truly solved the original fault.
2. Use Resolve-DnsName to test name resolution
An application usually begins with a hostname, not an address that an operator types from memory. Resolve-DnsName queries a name using Windows DNS client functionality. Microsoft documents -Name, -Type, -Server and -DnsOnly, among other options. The -DnsOnly switch is important when troubleshooting a case where local fallback mechanisms might otherwise obscure whether the configured DNS service actually resolved the name. The answer tells you about name resolution, not whether the application is reachable.
Resolve-DnsName -Name example.com -Type A
Resolve-DnsName -Name example.com -Type AAAA
Resolve-DnsName -Name example.com -DnsOnly
Record the query name, record type, resolution result and server context. A valid A record may not help an IPv6-only client, and a negative result might follow from a private split-horizon DNS zone that is only available after a VPN connection. A name may resolve to several addresses for legitimate load balancing; the existence of an address does not establish which server a failing client selected. DNS caching and short-lived changes complicate comparisons, so test the same query from the same operating conditions before drawing conclusions.
If a corporate service name fails but public names resolve, inspect whether the machine is using the expected internal resolver or DNS suffix. If both types fail, examine DNS reachability and configuration rather than assuming the public internet is down. Avoid changing production DNS records during an exploratory check. A DNS test should narrow the fault domain and produce evidence for the team that owns resolution policy.
3. Test a concrete connection with Test-NetConnection
Test-NetConnection supports connectivity diagnostics including ping and TCP port tests. In Microsoft’s output, PingSucceeded describes the specific ICMP test and TcpTestSucceeded describes an attempted TCP connection to a chosen port. The two do not mean the same thing. A host may block ICMP responses and still serve HTTPS successfully; conversely, a machine can answer ping while an application port is blocked or no service is listening.
Test-NetConnection -ComputerName example.com -Port 443
Test-NetConnection -ComputerName example.com -Port 443 -InformationLevel Detailed
Choose a hostname and port that the organization actually owns or is authorized to test. Do not label a failed ping as proof that the remote host is offline. Inspect the resolved address, selected local interface and TCP result. A successful TCP handshake does not prove that the application can authenticate a user, validate a TLS certificate or process an API request. Those are later-layer questions requiring application-aware tests. The purpose here is to establish whether this machine can make the specific network connection.
A detailed result may contain route and source-address information that becomes useful when a VPN or multi-homed machine behaves differently from other clients. Save the relevant fields and compare them with the intended design. If the port connection succeeds but a browser or application fails, advance the investigation to TLS, proxy, HTTP and identity behavior rather than repeatedly changing the interface configuration.
Read the three results together rather than searching for one magic command
Suppose a Windows laptop cannot open an internal HR portal. First confirm that the active adapter has the expected address and DNS settings. Then attempt to resolve the internal hostname with Resolve-DnsName. Finally test the appropriate TCP application port with Test-NetConnection. The order produces a useful decision tree: configuration missing, name-resolution failure, connection-path failure, or application-layer failure. Each branch suggests a different support team and a different evidence package.
If name resolution returns a private address but TCP fails from outside the VPN, the problem may be expected access policy rather than a broken service. If TCP reaches the service but the web page reports an authentication problem, resetting DNS would be an unrelated change. If configuration differs across users, capture the difference before escalating. Diagnostic discipline means deciding what the observation can actually prove and explicitly not inferring more than it supports.
What these commands do not prove
A successful test does not establish that a complete distributed application is healthy, that firewall policy permits every intended client, or that a remote service will behave reliably under load. The results are a snapshot of one source system, one target, one point in time and the available credentials. Windows PowerShell versions, module availability and enterprise endpoint restrictions also affect which commands and options can be used. Verify the commands against the Windows environment and the relevant official module reference before teaching them as universal syntax.
Test-Path is a separate PowerShell command for checking whether a specified path exists. It is useful for filesystem and other supported providers, but its result must not be presented as a general test of internet connectivity. Confusing local path existence with a network reachability test is a conceptual error. Choose a diagnostic command based on the question to be answered, rather than collecting similarly named PowerShell commands under a convenient headline.
Keep a small troubleshooting record
For an incident, write down the system, timestamp, target hostname and port, the relevant interface configuration, name-resolution outcome and TCP test result. Add the expected behavior, the difference from a known-good client, and the next team or action. If you change anything, record the before and after state and perform the original test again. This is more useful than a screenshot that shows only a green success field without the tested target or conditions.
The most defensible outcome is a narrow conclusion: the configured DNS server returned an address, or a TCP connection to a particular port succeeded, or this machine chose the wrong interface for the target. That language may sound less sweeping than “the internet works,” but it gives administrators evidence they can use without masking an application, identity or security-policy problem.
A controlled comparison beats an emergency network reset
If a colleague can reach the service while the affected machine cannot, compare the two machines under the same network conditions. Check whether both use the same resolver, whether one is connected to a VPN, and whether the TCP connection selects the same target address. The difference may be a host firewall, an identity condition, a route preference or a proxy requirement. These are hypotheses to test against evidence, not reasons to disable endpoint protection as a shortcut.
An administrator can prepare an escalation bundle without exposing secrets: operating-system and PowerShell version, interface summary, hostname and port, DNS result, connection result and timestamps. Avoid including tokens, credentials or confidential internal names in an external ticket. If a test uses a production service, coordinate with the service owner and respect maintenance policy. The purpose of these three commands is to make troubleshooting less disruptive by converting a vague symptom into a reproducible and bounded diagnosis.
Document the test’s limits before escalating
A DNS record can be changed immediately after the test, a mobile user can roam to another network, and a firewall can apply different policy based on source identity or location. A one-time command result is not a permanent service certificate. If the symptom is intermittent, repeat the same bounded test at several relevant times, capture context and compare with monitoring from the network and application teams. Preserve any error message exactly and distinguish a failed command execution from a valid command that returned a negative connectivity result.
A good network incident report should end with a next decision: gather application logs because TCP is reachable, involve DNS administrators because the expected internal zone is unresolved, or investigate routing because the selected gateway differs from the approved design. That is a practical improvement over any broad instruction to restart hardware or clear settings before recording what failed.