# ipconfig and ifconfig
## What are These Commands
Ipconfig is a command-line utility on Windows systems that displays the network configuration of all network interfaces. Ifconfig is the equivalent command on Unix and Linux systems, though modern Linux systems use the ip command instead. These commands show the IP address, subnet mask, default gateway, and MAC address of each network interface. They are essential tools for diagnosing network configuration problems.
## ipconfig on Windows
Running ipconfig in the Windows command prompt displays basic information for all network interfaces including the IP address, subnet mask, and default gateway. Running ipconfig with the slash all option displays detailed information including the MAC address, DHCP enabled status, DHCP server address, DNS servers, and lease information. The ipconfig slash release command releases the DHCP-assigned IP address. The ipconfig slash renew command requests a new IP address from the DHCP server. The ipconfig slash flushdns command clears the DNS resolver cache, which is useful when DNS problems are suspected due to stale cached records.
## ifconfig on Linux and macOS
The ifconfig command without arguments displays the configuration of all active network interfaces. The output includes the interface name, MAC address, IP address, subnet mask, broadcast address, and packet statistics. Running ifconfig with a specific interface name shows only that interface. Ifconfig can also be used to configure interfaces, assign IP addresses, bring interfaces up or down, and configure other parameters. On modern Linux systems the ip command has largely replaced ifconfig and provides more functionality.
## ip Command on Linux
The ip command is the modern replacement for ifconfig on Linux. The command ip address show or ip addr displays all interface addresses. The command ip link show displays link layer information including MAC addresses. The command ip route show displays the routing table. The ip command supports more features than ifconfig including display of IPv6 addresses, routing policy database, and network namespace management.
## Using These Commands for Troubleshooting
When a device cannot connect to the network, checking the IP address configuration is one of the first troubleshooting steps. If the IP address starts with 169.254 it is an APIPA address meaning the device could not reach a DHCP server and assigned itself an address. Verify the default gateway is correct for the network. Check that the DNS server addresses are configured. Compare the subnet mask with other devices on the same network to ensure they match.Back to Course