Windows IP Commands (ipconfig and PowerShell)

Updated: 2026-05-30

Command Prompt (classic)

ipconfig            :: address summary
ipconfig /all       :: full detail incl. MAC and DNS
ipconfig /flushdns  :: clear DNS cache
netstat -ano        :: connections with PID
nslookup example.com:: DNS lookup
tracert example.com :: path trace (like Linux traceroute)

PowerShell (modern)

PowerShell cmdlets return structured objects.

# Addresses
Get-NetIPAddress | Where-Object AddressFamily -eq IPv4

# Gateway, DNS and more
Get-NetIPConfiguration

# Port reachability (a better ping)
Test-NetConnection example.com -Port 443

# DNS lookup (dig-like)
Resolve-DnsName example.com -Type A
Resolve-DnsName 8.8.8.8 -Type PTR   # reverse

# Listening / active TCP
Get-NetTCPConnection -State Listen

Get Your Public IP

(Invoke-RestMethod https://show-ip-addr.com/api/myip).ip

In a browser, just open the home page to see your public IP with reverse DNS and registration data.

Sources