← all cheatsheets
Windows Net

Windows Net

CLI Networking Commands

ipconfignslookuppingtracertpathpingnetstatarphostnamegetmacnet usenet share

ipconfig

Displays the current network configuration of your device.

C:\> ipconfig
CommandDescription
ipconfigIP Address, Subnet Mask, Default Gateway
ipconfig /allMAC Address, DHCP Server, DNS Servers, Lease Time
ipconfig /releaseReleases current IP address
ipconfig /renewRequests new IP from DHCP
ipconfig /flushdnsClears DNS cache

nslookup

Used to query DNS information.

C:\> nslookup google.com

ping

Tests connectivity between your device and another device or server.

C:\> ping 8.8.8.8

tracert

Identifies the path packets take to reach the destination — pinpoints where packets drop.

C:\> tracert google.com

pathping

A combination of Ping and Tracert. Shows all hops, packet loss %, and connection quality.

C:\> pathping google.com

netstat

Displays all active connections and used ports.

C:\> netstat -an

arp

Displays the ARP Cache table — shows the relationship between IP and MAC addresses.

C:\> arp -a

hostname

Displays the current computer name. Important in Domain environments.

C:\> hostname

getmac

Displays the MAC address for all network adapters.

C:\> getmac

net use

Used to connect to a Shared Folder or Network Drive.

C:\> net use Z: \\Server\Files

net share

Displays all shared resources available on the device.

C:\> net share