The complete guide to ipconfig, ifconfig and friends
Whether you typed ipconfig into a Windows Command Prompt, ifconfig into a Mac or Linux terminal, or you just want to know why your computer has an address starting with 169.254, this site explains the tools, decodes the output and shows you the modern replacements.
Start with your platform
ipconfig
All 13 switches explained with real output, wildcards, DHCP class IDs, compartments and the errors you will actually see.
Linux · macOS · BSDifconfig
The 1983 original. Reading flags, setting addresses, aliases, MTU and promiscuous mode, and how output differs between Linux, macOS and FreeBSD.
Linuxip (iproute2)
The replacement for ifconfig, route and arp: addr, link, route, neigh, netns, JSON output and a side-by-side migration table.
macOSipconfig, networksetup, scutil
Yes, macOS has its own ipconfig, and it is nothing like the Windows one. Plus DNS, Wi-Fi and location commands.
netsh & PowerShell
Everything ipconfig cannot do: set static addresses, change DNS servers, reset the TCP/IP stack, dump Wi-Fi passwords and script it all.
Linuxnmcli, ss, resolvectl, ethtool
NetworkManager, systemd-networkd, Netplan, DHCP clients and the config files behind the commands.
Everything elseBSD, Solaris, Cisco, Android, Docker, WSL
The same job on routers, phones, containers and Unix systems you might meet in a data centre.
ReferenceCross-platform cheat sheet
One table: the same task on Windows CMD, PowerShell, Linux ip, ifconfig and macOS. Print it.
What these commands actually do
Every computer on a network has a set of interface settings: an IP address (or several), a subnet mask or prefix length, a default gateway, DNS servers and a hardware (MAC) address. These commands show you those settings and, in some cases, change them.
| Tool | Platform | Shows settings | Changes settings | Status |
|---|---|---|---|---|
ipconfig | Windows | Yes | Only DHCP release/renew, DNS cache, class IDs | Current, built in |
ifconfig | Linux | Yes | Yes (address, mask, MTU, up/down…) | Deprecated since ~2009, often not installed |
ifconfig | macOS, FreeBSD, OpenBSD, NetBSD | Yes | Yes, including Wi-Fi and VLANs on BSD | Current, actively maintained |
ip | Linux | Yes | Yes, everything | Current, the standard tool |
netsh | Windows | Yes | Yes, static IP, DNS, reset stack | Current, partly superseded by PowerShell |
PowerShell Get-Net* | Windows | Yes | Yes, via New-/Set- cmdlets | Current, recommended for scripting |
networksetup | macOS | Yes | Yes, per network service | Current |
nmcli | Linux with NetworkManager | Yes | Yes, persistent | Current |
The five-second version
ipconfig
ipconfig /all
ipconfig /release
ipconfig /renew
ipconfig /flushdnsThe first line shows address, mask and gateway per adapter. /all adds MAC address, DHCP server, lease times and DNS servers. Full ipconfig reference →
ip -br addr # one line per interface
ip addr show # full detail
ip route # routing table and default gateway
ip neigh # ARP / neighbour cache
resolvectl status # DNS servers (systemd-resolved)If you type ifconfig and get command not found, that is expected on modern distributions. Fix or replace it →
ifconfig en0 # Wi-Fi on most Macs
ipconfig getifaddr en0 # just the IPv4 address
networksetup -getinfo "Wi-Fi" # address, mask, router, MAC
scutil --dns # DNS configuration
route -n get default # default gatewayGet-NetIPConfiguration
Get-NetIPAddress -AddressFamily IPv4
Get-NetAdapter | Where-Object Status -eq Up
Get-DnsClientServerAddress
Clear-DnsClientCacheCommon questions, answered directly
- Why does my computer have an IP address starting 169.254?
- Your DHCP request went unanswered, so the operating system self-assigned a link-local address (APIPA on Windows, "self-assigned" on macOS). You will not reach the internet with it. Diagnose it →
- Is ipconfig the same as ifconfig?
- No. They share a purpose and a similar name but nothing else: different platforms, different syntax, different abilities. Full comparison →
- How do I find my public IP address?
- None of these commands show it, because your router translates addresses. Use the live checker or
curl ipconfig.co.uk/ipfrom any terminal. - What is the difference between
ipconfig /releaseand/renew? - Release tells the DHCP server you are giving the address back and leaves the adapter with no address. Renew asks for a lease again. You usually run both, in that order. Details →
- How do I flush the DNS cache?
- Windows
ipconfig /flushdns; macOSsudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder; Linuxresolvectl flush-caches. Every platform, including browsers →
How this site is organised
- Command references cover one tool each, every option, with sample output you can compare to your own screen.
- Reading the output explains what each line means: subnet masks and CIDR, IPv6 address types, temporary addresses, zone IDs, MAC formats, DHCP leases.
- Troubleshooting is a symptom-first playbook: no gateway, media disconnected, can ping an IP but not a name, duplicate addresses, DHCP failures.
- Background pages cover the history from 4.2BSD to iproute2, a glossary and an FAQ.