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.
Do a specific job
Open a command line
Command Prompt, PowerShell, Terminal; run as administrator or with sudo; copy and save the output.
How-toSet a static IP address
Every platform, plus why a DHCP reservation on the router is usually the better answer.
How-toChange DNS servers
Cloudflare, Google, Quad9 and others; per device, per router, per browser; encrypted DNS.
How-toFind your router's IP
The default gateway, default logins for UK ISP hubs and major brands, and what 192.168.1.254 means.
How-toFlush the DNS cache
Windows, every macOS version, Linux resolvers, browsers and routers.
How-toIPv6: check, prefer IPv4, disable
Why you have four IPv6 addresses, how to tell if IPv6 works, and the right way to turn it off.
How-toMAC addresses
Find, change, randomise; OUI lookup; why MAC filtering is not security.
ExplainerHow DHCP works
DISCOVER, OFFER, REQUEST, ACK; leases and renewal; options; reservations; rogue servers.
ToolSubnet & IPv6 calculator
Network, broadcast, host range, wildcard and binary from any address and mask. IPv6 expand and compress.
AutomationScripts
Get just the IP, alert on public IP change, export a report, wait for the network, toggle static and DHCP.
FixError messages A–Z
Every message these tools print, with the cause and the fix.
FixTroubleshooting playbook
169.254 addresses, no gateway, media disconnected, DNS, duplicate IPs, MTU, Wi-Fi with no internet.
The tools around ipconfig
ping, traceroute, mtr
Options on each platform, reading replies and every error message, pathping and tracepath.
nslookup, dig, host
Query any record type, ask a specific server, trace delegation, read dig output.
netstat, ss, lsof
What is listening, what is connected, and what is using port 8080.
Wi-Fi from the command line
SSID, signal, channel, saved passwords, scanning and connecting on Windows, macOS and Linux.
iwconfig, iwlist, iwgetid
The legacy Linux wireless tools: reading their output and what replaced them.
ip a, ip a s, ip r
Every ip shortcut expanded, and the one that does not mean what you think.
route
route print, add, delete and persistent routes on Windows, Linux, macOS and BSD.
arp
The ARP cache, static entries, arping, and spotting duplicate addresses or spoofing.
hostname
See and change the computer name; how devices find each other by name.
netsh reference
Every context that matters: interface, wlan, advfirewall, winsock, portproxy, trace.
tcpdump, Wireshark, pktmon
See the actual packets: filters, recipes for DHCP, DNS and ARP, and reading a handshake.
Firewall commands
Is the port blocked, and where? Windows Firewall, ufw, firewalld, nftables, iptables, pf.
Every device on your network
Router list, arp-scan, nmap, mDNS, and identifying the one you do not recognise.
Speed and throughput
speedtest, curl and iperf3; link speed vs real throughput; bufferbloat.
Command index A–Z
Every command on the site, alphabetically, with platform and purpose.
Which command looks where
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.
- How-to guides walk through one job each: static IP, DNS servers, router address, IPv6, MAC addresses, DHCP, scripts.
- Background pages cover the history from 4.2BSD to iproute2, a glossary and an FAQ.