Below are some useful commands for checking IP information on various operating systems.
Command to check IP configuration:
ipconfig
This command displays the IP configuration for all network interfaces on a Windows system.
Command to release IP address:
ipconfig /release
This command releases the IP address for all network interfaces on a Windows system.
Command to renew IP address:
ipconfig /renew
This command renews the IP address for all network interfaces on a Windows system.
Command to display DNS resolver cache:
ipconfig /displaydns
This command displays the contents of the DNS client resolver cache.
Command to flush DNS resolver cache:
ipconfig /flushdns
This command purges the DNS client resolver cache, releasing all cached DNS entries.
Command to reset TCP/IP stack:
netsh int ip reset
This command resets the TCP/IP stack back to default settings.
Command to display network configuration:
netsh interface ip show config
This command shows detailed network configuration information.
Command to show DHCP configuration:
ipconfig /all
This command displays detailed DHCP configuration information for all interfaces.
Command to release and renew DHCP IP:
ipconfig /release && ipconfig /renew
This command releases the current DHCP configuration and renews it.
Command to show network connections:
netstat -nao
This command displays all active network connections and listening ports.
Command to check network interface details:
ifconfig
This command displays the configuration details of network interfaces on a Mac system.
Command to show IP address of a specific interface (e.g., en0):
ipconfig getifaddr en0
This command shows the IP address of the specified network interface on a Mac system.
Command to show current Wi-Fi network details:
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I
This command shows detailed information about the current Wi-Fi network.
Command to display all available Wi-Fi networks:
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s
This command scans and lists all Wi-Fi networks in range.
Command to flush DNS cache:
sudo killall -HUP mDNSResponder
This command flushes the DNS cache on a Mac system.
Command to ping a host and check connectivity:
ping google.com
This command pings a remote server (e.g., Google) to check network connectivity.
Command to check active connections:
netstat -an
This command displays active network connections.
Command to reset the network interface (example for en0):
sudo ifconfig en0 down && sudo ifconfig en0 up
This command resets the specified network interface by taking it down and bringing it back up.
Command to display routing table:
netstat -rn
This command shows the routing table of the system, displaying how packets are routed.
Command to show network statistics:
nettop
This command provides real-time network statistics, showing traffic details for all interfaces.
Command to show IP address information:
ip a
Command to show DNS information:
cat /etc/resolv.conf
Command to show routing table:
ip route
Command to show network statistics:
netstat -s
Command to display active network connections:
ss -tuln
Command to test network connectivity:
ping google.com
Command to display current firewall rules:
sudo iptables -L
Command to flush DNS cache:
sudo systemd-resolve --flush-caches
Command to view network interface configuration:
ifconfig
Command to set a static IP address:
sudo ip addr add 192.168.1.100/24 dev eth0