ipconfig vs ifconfig: what is actually different
They are often treated as the same command with a letter swapped. They are not. One is a Windows display tool with a handful of DHCP and DNS switches; the other is a Unix configuration tool from 1983 that can rewrite an interface's address, mask and hardware settings. This page lines them up.
At a glance
| ipconfig | ifconfig | |
|---|---|---|
| Platform | Windows (NT 3.5 onward). A different, unrelated ipconfig exists on macOS. | Unix: Linux (net-tools), macOS, FreeBSD, OpenBSD, NetBSD, Solaris, AIX, HP-UX |
| First appeared | 1994 (Windows NT 3.5); Windows 95 had a limited version plus the graphical winipcfg | 1983 (4.2BSD); Linux port 1992–93 |
| Name means | IP configuration | Interface configuration |
| Main purpose | Display TCP/IP settings; manage DHCP leases; manage the DNS client cache | Display and set interface parameters: addresses, masks, MTU, flags, MAC |
| Can set an IP address? | No | Yes |
| Can bring an interface up/down? | No | Yes |
| Can release/renew DHCP? | Yes (/release, /renew) | No; use dhclient, dhcpcd, nmcli, or macOS ipconfig set en0 DHCP |
| Can flush DNS? | Yes (/flushdns) | No |
| Shows DNS servers? | Yes (/all) | No |
| Shows default gateway? | Yes | No; use route, ip route or netstat -rn |
| Shows DHCP server and lease? | Yes (/all) | No |
| Shows packet counters? | No | Yes |
| Shows link state? | Yes (Media disconnected) | Yes (RUNNING flag; status: on BSD) |
| Option syntax | Slash switches: /all, /renew | Keywords: eth0 up, eth0 mtu 9000; a few dash flags (-a, -s) |
| Needs elevation for | Release, renew, registerdns, setclassid | Any change; viewing is unprivileged |
| Status | Current, built in, unchanged since Vista | Deprecated on Linux (replaced by ip); current on macOS and BSD |
| Modern replacement | PowerShell Get-NetIPConfiguration for scripting; netsh for changes | Linux: ip. macOS: networksetup for persistent changes. |
Same information, different shape
Here is one Ethernet interface on a machine with the same address, as each tool would show it.
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . : home
Link-local IPv6 Address . . . . . : fe80::1c3e:7a2f:9d4b:6e01%12
IPv4 Address. . . . . . . . . . . : 192.168.1.42
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.42 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::a00:27ff:fe4e:66a1 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:4e:66:a1 txqueuelen 1000 (Ethernet)
RX packets 184213 bytes 231770215 (221.0 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 97312 bytes 11284570 (10.7 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0Notice what each leaves out. ipconfig has no MAC address or counters until you add /all, and never shows the MTU. ifconfig never shows the gateway or DNS. The Unix philosophy splits those into route and resolv.conf; Windows bundles everything into one report.
Equivalent commands
| Task | Windows ipconfig | Unix ifconfig (+ friends) | Linux ip |
|---|---|---|---|
| Show configuration | ipconfig | ifconfig | ip -br addr |
| Show everything | ipconfig /all | ifconfig -a + route -n + cat /etc/resolv.conf | ip addr + ip route + resolvectl status |
| Release DHCP | ipconfig /release | dhclient -r eth0 | nmcli con down "X" |
| Renew DHCP | ipconfig /renew | dhclient eth0 | nmcli con up "X" |
| Flush DNS | ipconfig /flushdns | sudo killall -HUP mDNSResponder (macOS) | resolvectl flush-caches |
| Show DNS cache | ipconfig /displaydns | n/a | resolvectl statistics |
| Set static IP | n/a (netsh) | ifconfig eth0 192.168.1.50 netmask 255.255.255.0 | ip addr add 192.168.1.50/24 dev eth0 |
| Interface down | n/a (netsh) | ifconfig eth0 down | ip link set eth0 down |
| Set MTU | n/a (netsh) | ifconfig eth0 mtu 1400 | ip link set eth0 mtu 1400 |
| Change MAC | n/a (Device Manager) | ifconfig eth0 hw ether … | ip link set eth0 address … |
Why the names are similar
Both are contractions in the Unix naming tradition. ifconfig configures interfaces. Microsoft's TCP/IP stack for Windows NT was developed in the early 1990s, when ifconfig was the obvious model, and its diagnostic tool was named for what it shows: the IP configuration. The Windows tool was never intended to configure anything, which is why its writing abilities stop at DHCP and DNS-cache housekeeping. Apple's separate ipconfig came from NeXTSTEP-era Mac OS X and controls the IP configuration daemon; the name is a coincidence, not a port. Full history →
Which one should you learn?
- You use Windows:
ipconfigfor looking,netshor PowerShell for changing. There is nothing else. - You use Linux: learn
ip.ifconfigmay not even be installed, and when it is, it hides addresses and cannot do half of what you need. Muscle memory forifconfigis fine for a quick look. - You use macOS:
ifconfigfor looking,networksetupfor changing,ipconfig getifaddr en0for scripts. - You use BSD:
ifconfig, wholeheartedly. It is the primary, maintained tool there. - You use all of them: the cheat sheet exists for you.