Why These Commands Matter
Before you can diagnose a network problem, you need to know what your machine thinks its network configuration is. Is it using the right IP address? Does it have a default gateway? Is DHCP enabled or is the address static? ipconfig on Windows and ifconfig on Linux and macOS answer all of these questions in seconds. They are the starting point for virtually every network troubleshooting workflow.
ipconfig on Windows
Run ipconfig without arguments for a concise summary of all active network adapters:
ipconfig
Output:
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . : home
IPv4 Address. . . . . . . . . . . : 192.168.1.50
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
Wireless LAN adapter Wi-Fi:
Media State . . . . . . . . . . . : Media disconnected
For complete detail — including MAC address, DHCP lease times, and DNS server addresses — add the /all flag:
ipconfig /all
Key fields in ipconfig /all output and what they mean:
- Physical Address: The MAC address of the network adapter — a hardware identifier burned into the card.
- DHCP Enabled: Whether the IP address was assigned automatically (Yes) or configured manually (No).
- IPv4 Address: Your local network IP. A 192.168.x.x or 10.x.x.x address is a private address behind a router.
- Subnet Mask: Defines which part of the IP address identifies the network vs the host.
- Default Gateway: The IP of your router — where traffic goes when it is destined for outside your local network.
- DNS Servers: The resolvers your machine uses to look up domain names.
Managing DHCP and DNS Cache with ipconfig
ipconfig does more than display information. Several flags perform network management tasks:
ipconfig /release # Release the current DHCP-assigned IP address
ipconfig /renew # Request a new IP address from the DHCP server
ipconfig /flushdns # Clear the local DNS resolver cache
ipconfig /displaydns # Show the contents of the DNS cache
Flushing the DNS cache is one of the most common first steps when a website seems to be resolving to the wrong IP address. Windows caches DNS responses locally to avoid repeated lookups, and this cache can become stale after a domain changes its DNS records.
ifconfig on Linux and macOS
Run ifconfig without arguments to see all active interfaces:
ifconfig
Output on Linux:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.50 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::a00:27ff:fe8d:c04d prefixlen 64 scopeid 0x20<link>
ether 08:00:27:8d:c0:4d txqueuelen 1000 (Ethernet)
RX packets 12345 bytes 9876543 (9.4 MiB)
TX packets 5678 bytes 1234567 (1.1 MiB)
Key fields: inet is the IPv4 address, inet6 is the IPv6 address, ether is the MAC address, netmask is the subnet mask, and broadcast is the broadcast address for the subnet. The RX/TX counters show total bytes received and transmitted since the interface came up.
To inspect a single interface:
ifconfig eth0
The loopback interface (lo or lo0 on macOS) always has the address 127.0.0.1 and is used for local inter-process communication.
ipconfig vs ifconfig vs ip — Comparison
| Task | Windows (ipconfig) | Linux/macOS (ifconfig) | Modern Linux (ip) |
|---|---|---|---|
| Show all interfaces | ipconfig |
ifconfig |
ip addr show |
| Show full detail | ipconfig /all |
ifconfig -a |
ip -detail addr |
| Find MAC address | ipconfig /all |
ifconfig (ether field) |
ip link show |
| Release DHCP lease | ipconfig /release |
via dhclient -r | via dhclient -r |
| Flush DNS cache | ipconfig /flushdns |
via systemd-resolve | via systemd-resolve |
| Bring interface up/down | via Device Manager | ifconfig eth0 up/down |
ip link set eth0 up/down |
ifconfig Is Deprecated on Modern Linux
On modern Linux distributions, ifconfig is part of the net-tools package, which is no longer actively maintained. The replacement is the ip command from the iproute2 package, which covers everything ifconfig does and more. Many minimal Linux distributions no longer install net-tools by default. If ifconfig is not found, use ip addr show instead — it provides the same core information in a slightly different format.
Frequently Asked Questions
How do I find my IP address with ipconfig?
Open Command Prompt and run ipconfig. Look for the "IPv4 Address" field under the active adapter (Ethernet or Wi-Fi). For full detail including MAC address, DNS servers, and DHCP status, run ipconfig /all instead.
What does ipconfig /flushdns do?
ipconfig /flushdns clears the Windows DNS resolver cache — the local store of recently resolved hostnames. This forces Windows to perform fresh DNS lookups for all hostnames. It is useful when a website has changed its IP address and your machine keeps resolving to the old cached address.
What is the difference between ipconfig and ifconfig?
ipconfig is the Windows command for displaying network interface configuration. ifconfig is the equivalent for Linux and macOS. They display similar information — IP address, subnet mask, default gateway, MAC address — but have different flag syntax and different additional capabilities. On modern Linux, ifconfig has been superseded by the ip command.
How do I renew my DHCP lease with ipconfig?
Run ipconfig /release to release the current DHCP lease, then run ipconfig /renew to request a new one. This is useful when your IP address is stale, conflicting with another device, or when you have moved to a different network segment and need a fresh assignment.
Is ifconfig available on modern Linux?
ifconfig is available on most Linux distributions but is considered deprecated. Modern Linux distributions prefer the ip command (from the iproute2 package), which provides a superset of ifconfig's functionality with a more consistent interface. ifconfig may not be installed by default on minimal or server-oriented distributions.
How do I find my MAC address with ipconfig or ifconfig?
On Windows, run ipconfig /all and look for the "Physical Address" field under the relevant adapter. On Linux or macOS, run ifconfig and look for the "ether" field next to each interface name. On modern Linux, you can also use ip link show to display MAC addresses for all interfaces.