Skip to content

Test whether a website or server port is reachable — via Microsoft Learn

Commandlow riskWindows 11Windows 10

Instead of guessing whether a firewall is blocking something, PowerShell's Test-NetConnection tries a real TCP connection to any host and port and tells you TcpTestSucceeded True or False.

Takes effect right away

Command

Run in a normal PowerShell / Terminal window.

Test-NetConnection -ComputerName example.com -Port 443
Test-NetConnection -ComputerName 192.168.1.10 -Port 3389 -InformationLevel Detailed

Undo

# Read-only test: nothing to undo.
Detailed output adds the interface and source address used, which helps with VPN or multi-adapter problems. Without -Port it does a ping test.

Sources

Source reviewed
2026-11-02
Link checked
2026-11-02
Tested hands-on
Not by Oddbyte.Me

Oddbyte.Me hasn't tried this on every Windows build, so keep the undo handy.

test-netconnectionport checkfirewallpowershelltelnet alternative

More in Networking

Flush the DNS cache — via Marc Abramowitz

Commandlow riskAdmin

If a website moved to a new server, or you changed DNS settings and some sites still won't load, your Mac may be holding on to old address lookups. Flushing the DNS cache makes it look them up fresh. It's a troubleshooting step, not a speed boost.

Run Apple's built-in internet speed test — via SS64

Commandlow risk

macOS has its own speed test in Terminal. Besides download and upload speed, it measures 'responsiveness' (round trips per minute while the line is busy), which explains why video calls stutter on a connection that looks fast.