ipconfig vs ifconfig – IP Configuration Commands for Windows and Linux
1. What Are ipconfig and ifconfig?
ipconfig and ifconfig are command-line utilities that let you view and manage the IP configuration of network interfaces on a host. They are the first tools any network engineer reaches for when diagnosing a connectivity problem — before pinging, before tracing a route, before anything else. If the host does not have a valid IP address, subnet mask, and default gateway, nothing else will work.
Despite serving the same diagnostic purpose, the two tools exist on
different operating systems, use different syntax, and have different
capabilities. ipconfig is the Windows standard; ifconfig is
the traditional Unix/Linux/macOS tool, largely superseded on modern Linux
by the ip command from the iproute2 package.
| Aspect | ipconfig (Windows) | ifconfig (Linux / macOS) | ip command (Modern Linux) |
|---|---|---|---|
| Platform | Windows (all versions) | Linux, macOS, BSD Unix | Linux (replaces ifconfig) |
| Package / Origin | Built into Windows | net-tools package (legacy) |
iproute2 package (modern standard) |
| Primary Function | View IP settings; release and renew DHCP leases; flush DNS cache | View interfaces; assign IPs; bring interfaces up/down | Full interface and routing management — superset of ifconfig |
| Can Assign IP? | No (read + DHCP management only) | Yes — ifconfig eth0 192.168.1.10 netmask 255.255.255.0 |
Yes — ip addr add 192.168.1.10/24 dev eth0 |
| Status on Modern Systems | Current — still the standard on all Windows versions | Deprecated on most Linux distros; not installed by default | Current standard — use this for all new Linux work |
Related pages: DHCP Overview | How DHCP Works | How DNS Works | MAC Addresses | Applying ACLs | Troubleshooting Methodology | show ip interface brief | show interfaces Command | Common Port Numbers | Troubleshooting DHCP Clients Lab
2. Windows — ipconfig Command Reference
Run all ipconfig commands from a Command Prompt
(cmd.exe) or PowerShell. No elevated privileges are needed
for read-only commands; DHCP and flush operations may require running
as Administrator.
| Command | What It Does | When to Use It |
|---|---|---|
ipconfig |
Displays the IPv4 address, subnet mask, and default gateway for each active adapter. The quickest sanity check. | First step in any Windows connectivity diagnosis — verify the host has a valid IP and gateway |
ipconfig /all |
Full detail: adds DHCP server address, lease obtained/expires timestamps, DNS servers, Physical Address (MAC), DHCP enabled flag, IPv6 address, and autoconfiguration address | When you need to confirm DHCP server identity, check lease expiry, verify DNS servers, or read the MAC address |
ipconfig /release |
Sends a DHCPRELEASE message to the DHCP server, surrendering the current lease. The adapter address drops to 0.0.0.0. | Before requesting a new IP; resolving IP address conflicts; moving to a different DHCP scope |
ipconfig /renew |
Sends a DHCPREQUEST or DHCPDISCOVER to obtain a new IP address lease from the DHCP server | After /release; after fixing a DHCP server issue;
when the host has an APIPA address (169.254.x.x) |
ipconfig /flushdns |
Clears the Windows DNS resolver cache — removes all cached DNS entries, both positive (successful lookups) and negative (failed lookups) | After a DNS record change that is not yet reflected in responses; when a host resolves to a stale/incorrect IP; clearing a negative cache entry after fixing a DNS problem |
ipconfig /displaydns |
Shows the current contents of the local DNS resolver cache — every hostname the system has recently resolved, with TTL remaining | Confirming which IP a hostname resolves to locally; checking whether a DNS flush is needed; DNS troubleshooting |
ipconfig /registerdns |
Forces a dynamic DNS registration — re-registers the host's name and IP with the DNS server | After an IP change when the DNS record has not updated; Active Directory environments where dynamic DNS registration is used |
ipconfig /all — Annotated Output
C:\> ipconfig /all
Windows IP Configuration
Host Name . . . . . . . . . . . . : DESKTOP-JOHN ← Computer name
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Intel(R) Ethernet Connection ← NIC model
Physical Address. . . . . . . . . : 00-1A-2B-3C-4D-5E ← MAC address
DHCP Enabled. . . . . . . . . . . : Yes ← Dynamic IP
Autoconfiguration Enabled . . . . : Yes
IPv4 Address. . . . . . . . . . . : 192.168.1.100(Preferred) ← IP address
Subnet Mask . . . . . . . . . . . : 255.255.255.0 ← /24 network
Lease Obtained. . . . . . . . . . : Monday, 16 March 2026 08:00 ← DHCP lease start
Lease Expires . . . . . . . . . . : Tuesday, 17 March 2026 08:00 ← Lease expiry
Default Gateway . . . . . . . . . : 192.168.1.1 ← Router IP
DHCP Server . . . . . . . . . . . : 192.168.1.1 ← DHCP server
DNS Servers . . . . . . . . . . . : 8.8.8.8 ← Primary DNS
8.8.4.4 ← Secondary DNS
NetBIOS over Tcpip. . . . . . . . : Enabled
3. Linux / macOS — ifconfig Command Reference
ifconfig is part of the legacy net-tools package.
On modern Debian/Ubuntu systems it is no longer installed by default
(sudo apt install net-tools to restore it). For new work,
always prefer the ip command — but ifconfig
remains widely encountered and is still tested on the CCNA.
| Command | What It Does | When to Use It |
|---|---|---|
ifconfig |
Lists all currently active (UP) interfaces with their IP addresses, netmask, broadcast address, MAC, MTU, and packet counters | Quick check of active interfaces and their addresses |
ifconfig -a |
Shows all interfaces — including those in the DOWN state
that would be hidden by plain ifconfig |
Checking whether an interface exists but is down; diagnosing a missing interface |
ifconfig eth0 |
Displays configuration for the specific named interface only | Focused inspection of one interface without scrolling through all |
sudo ifconfig eth0 up |
Brings the named interface to the UP/active state | Enabling a disabled interface; recovering from accidental shutdown |
sudo ifconfig eth0 down |
Shuts down the named interface — takes it offline | Before changing its configuration; isolating a suspect interface during troubleshooting |
sudo ifconfig eth0 192.168.1.50 netmask 255.255.255.0 |
Assigns a static IP address and subnet mask to the interface. Change is temporary — lost on reboot unless persisted in config files. | Quick temporary address assignment in a lab or for testing |
ifconfig — Annotated Output
$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
│ │ └─ MTU: max frame size in bytes
│ └─ Interface flags: UP=active, BROADCAST=supports broadcast,
│ RUNNING=driver loaded, MULTICAST=supports multicast
└─ Interface name
inet 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255
│ │ └─ Broadcast address for this subnet
│ └─ Subnet mask (/24)
└─ IPv4 address
inet6 fe80::1c3b:22ff:fe4b:a8e3 prefixlen 64 scopeid 0x20<link>
└─ IPv6 link-local address (fe80::/10 range, not routable off-link)
ether 00:1c:42:4b:a8:e3 txqueuelen 1000 (Ethernet)
│ └─ Transmit queue length
└─ MAC address (Layer 2 hardware address)
RX packets 84231 bytes 102457890 (97.7 MiB) ← Received packet/byte counters
RX errors 0 dropped 0 overruns 0 frame 0 ← Error counters (should all be 0)
TX packets 61204 bytes 8743210 (8.3 MiB) ← Transmitted counters
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
4. Modern Linux — The ip Command (iproute2)
The ip command from the iproute2 suite is the
current standard on all modern Linux distributions. It is more powerful,
more consistent, and more scriptable than ifconfig. The CCNA
exam increasingly references it alongside ifconfig.
| Task | Legacy ifconfig Command | Modern ip Command |
|---|---|---|
| Show all interfaces and IPs | ifconfig -a |
ip addr show or ip a |
| Show one interface | ifconfig eth0 |
ip addr show eth0 |
| Bring interface up | sudo ifconfig eth0 up |
sudo ip link set eth0 up |
| Bring interface down | sudo ifconfig eth0 down |
sudo ip link set eth0 down |
| Assign static IP | sudo ifconfig eth0 192.168.1.10 netmask 255.255.255.0 |
sudo ip addr add 192.168.1.10/24 dev eth0 |
| Remove IP address | sudo ifconfig eth0 0.0.0.0 |
sudo ip addr del 192.168.1.10/24 dev eth0 |
| Show routing table | route -n |
ip route show or ip r |
| Show link-layer (MAC) info | ifconfig eth0 (includes ether line) |
ip link show eth0 |
Note on DHCP with the ip command: The ip command itself
does not handle DHCP — it only manages static addressing. To request a DHCP
address on Linux, use sudo dhclient eth0 (ISC dhclient) or
sudo dhcpcd eth0 depending on which DHCP client is installed.
The DHCP client communicates with the server and then calls ip
internally to set the received address.
5. Reading and Interpreting the Output Fields
Knowing what each field means is what turns raw command output into a
diagnosis. These fields appear in both ipconfig /all and
ifconfig / ip addr output, though under different
labels.
| Field | Windows Label | Linux Label | What It Means and Why It Matters |
|---|---|---|---|
| IPv4 Address | IPv4 Address | inet |
The Layer 3 address assigned to this interface. If this shows 169.254.x.x (APIPA) or is missing entirely, the host cannot communicate on the network. |
| Subnet Mask | Subnet Mask | netmask (ifconfig) / prefix length e.g. /24 (ip) |
Defines which part of the IP address is the network and which is the host. A mismatch with other hosts on the same segment prevents communication even if IPs appear correct. |
| Default Gateway | Default Gateway | ip route show (default via x.x.x.x) |
The router IP for sending traffic off the local subnet. If this is missing or wrong, the host can communicate locally but cannot reach any other network or the internet. |
| MAC Address | Physical Address | ether |
The Layer 2 hardware address burned into the NIC. Used by ARP to map IPs to hardware. Helps identify the specific NIC when troubleshooting hardware issues. |
| DHCP Enabled | DHCP Enabled: Yes/No | No direct equivalent — inferred from whether a DHCP client assigned the address | Confirms whether the address was assigned dynamically or configured statically. Unexpected "No" means someone set a static IP — which may conflict with the DHCP range. |
| DHCP Server | DHCP Server | Seen in DHCP client logs (journalctl) |
The IP of the server that granted the lease. Useful for confirming the correct DHCP server responded — a rogue DHCP server would show an unexpected IP here. |
| DNS Servers | DNS Servers | /etc/resolv.conf (nameserver lines) |
The servers used for hostname resolution. If wrong or unreachable, hostnames won't resolve even though IP connectivity may be fine. |
| IPv6 Address | IPv6 Address / Link-local IPv6 Address | inet6 |
The fe80:: link-local address is always present on
any active interface. A full global unicast IPv6 address (2000::/3)
indicates IPv6 connectivity beyond the local link. |
| Lease Obtained / Expires | Lease Obtained / Lease Expires | DHCP client logs | Shows when the DHCP lease was granted and when it will expire. A lease about to expire, or one that expired in the past and was not renewed, can cause intermittent connectivity loss. |
| Interface Status | Media State: Connected / Media disconnected | flags: UP/DOWN; RUNNING | "Media disconnected" (Windows) or missing the UP/RUNNING flags (Linux) means the physical or logical link is down — check the cable, port, and NIC before investigating anything else. |
6. DHCP Release and Renew — How It Works
Understanding what actually happens during a release/renew cycle is a CCNA exam topic and essential for real-world DHCP troubleshooting.
ipconfig /release ipconfig /renew
│ │
▼ ▼
Client sends DHCPRELEASE Client sends DHCPDISCOVER
to DHCP server (broadcast — seeking any DHCP server)
│ │
Server marks IP as available Server replies DHCPOFFER
│ (offers an IP address)
Client IP → 0.0.0.0 │
(no connectivity) Client sends DHCPREQUEST
(formally requesting the offered IP)
│
Server sends DHCPACK
(confirms the lease)
│
Client configures IP, mask, gateway, DNS
(connectivity restored)
On Linux, the equivalent is:
Release: sudo dhclient -r eth0 (sends DHCPRELEASE, removes address)
Renew: sudo dhclient eth0 (runs full DORA: Discover, Offer, Request, Ack)
When to use release/renew: If a host has an APIPA address
(169.254.x.x) — meaning the DHCP server did not respond — try
ipconfig /renew after confirming the DHCP server is reachable
and the network connection is physically up. Do not release/renew
repeatedly in quick succession — it can cause the DHCP server to exhaust
its address pool with phantom leases on some implementations.
7. APIPA — Automatic Private IP Addressing (169.254.x.x)
APIPA (Automatic Private IP Addressing) is the Windows mechanism
(defined in RFC 3927 as "link-local addressing") that automatically assigns
an address in the 169.254.0.0/16 range when a host is
configured for DHCP but cannot reach a DHCP server.
Host boots → DHCP Discover sent (broadcast) →
No DHCP server responds within timeout →
Windows auto-assigns 169.254.x.x /16
(x.x is randomly chosen; host verifies uniqueness via ARP probe)
Result: Host has an IP — but it is only usable for
communication with OTHER hosts on the same segment
that also have 169.254.x.x addresses.
No gateway, no DNS, no internet access.
| Indicator | What It Tells You | What to Check |
|---|---|---|
| 169.254.x.x address in ipconfig | The host did not receive a DHCP response — it fell back to APIPA | Physical connection (cable/Wi-Fi); DHCP server availability; DHCP scope exhaustion; correct VLAN/subnet reachability to DHCP server |
| 0.0.0.0 address in ipconfig | DHCP release was performed and no new lease has been obtained yet | Run ipconfig /renew |
| Static IP outside expected range | DHCP is disabled and a manually configured IP is in use | Verify whether static addressing is intentional; check for conflicts with the DHCP pool range |
Linux assigns a similar 169.254.x.x link-local address via
the zeroconf / avahi mechanism when no DHCP
response is received, though behaviour varies by distribution and
configuration.
8. DNS Cache — ipconfig /flushdns and /displaydns
Windows maintains a local DNS resolver cache to speed up repeated lookups. Every hostname-to-IP resolution is stored here, along with its remaining TTL. This cache can become a source of problems when DNS records change.
| Command | Effect | Typical Scenario |
|---|---|---|
ipconfig /displaydns |
Prints every cached DNS entry — hostname, record type, TTL remaining, and resolved IP | Confirming what IP a hostname resolves to locally; checking whether a stale entry is causing connectivity to the wrong server |
ipconfig /flushdns |
Empties the entire DNS resolver cache immediately. The next lookup for any hostname goes directly to the DNS server. | A website moved to a new IP but the old IP is still cached; a DNS record was corrected but the fix isn't visible yet; clearing a negative cache entry (NXDOMAIN) after adding a record |
The Linux equivalent is service-dependent. For systemd-resolved
(most modern distros): sudo resolvectl flush-caches. For
nscd: sudo nscd -i hosts.
9. ipconfig vs ifconfig — Side-by-Side Comparison
| Feature | ipconfig (Windows) | ifconfig (Linux/macOS) |
|---|---|---|
| View active interfaces | ipconfig |
ifconfig |
| View all details including MAC and DNS | ipconfig /all |
ifconfig -a (partial); full DNS in /etc/resolv.conf |
| Show down interfaces | ipconfig /all (shows "Media disconnected") |
ifconfig -a |
| Release DHCP lease | ipconfig /release |
sudo dhclient -r eth0 |
| Renew DHCP lease | ipconfig /renew |
sudo dhclient eth0 |
| Flush DNS cache | ipconfig /flushdns |
sudo resolvectl flush-caches (systemd-resolved) |
| Assign static IP | Not possible via ipconfig — use Network Settings GUI or netsh | sudo ifconfig eth0 x.x.x.x netmask y.y.y.y |
| Bring interface up/down | Not possible via ipconfig — use Device Manager or netsh | sudo ifconfig eth0 up/down |
| View routing table | route print or netstat -r |
route -n or ip route show |
| Output style | One block per adapter with labelled fields — human-readable | One block per interface with condensed technical fields |
10. Troubleshooting Workflow — Step-by-Step
A structured approach to diagnosing connectivity problems using these tools. Work from the bottom of the OSI stack upward — confirm Layer 1 and Layer 2 before blaming Layer 3.
PROBLEM: Host cannot reach the internet or a remote host
═══════════════════════════════════════════════════════
Step 1 — Check the IP assignment
─────────────────────────────────
Windows: ipconfig
Linux: ip addr show (or ifconfig)
┌─ 169.254.x.x? → APIPA — DHCP server not reachable
│ Fix: Check cable/Wi-Fi; run ipconfig /renew; verify DHCP server is up
├─ 0.0.0.0? → No IP at all — interface may be down or DHCP released
│ Fix: ipconfig /renew (Windows) or sudo dhclient eth0 (Linux)
├─ Wrong subnet (e.g. 10.0.0.x when expecting 192.168.1.x)? → Wrong DHCP scope
│ or rogue DHCP server. Check ipconfig /all for DHCP Server field.
└─ Correct IP? → Proceed to Step 2
Step 2 — Verify the default gateway
─────────────────────────────────────
Windows: ipconfig (Default Gateway field)
Linux: ip route show (look for "default via x.x.x.x")
┌─ Gateway missing or 0.0.0.0? → Host can communicate locally
│ but cannot reach any other subnet or the internet
│ Fix: Check DHCP server gateway option; set static route if needed
└─ Gateway present? → Ping it: ping 192.168.1.1
┌─ Ping fails? → Layer 1/2 issue (cable, port, VLAN) or firewall
└─ Ping succeeds? → Local network OK; proceed to Step 3
Step 3 — Verify DNS
────────────────────
Windows: ipconfig /all (DNS Servers field)
ipconfig /displaydns (check cache for stale entries)
Linux: cat /etc/resolv.conf (nameserver lines)
┌─ DNS servers missing? → DHCP did not push DNS; configure manually
├─ DNS servers present but names don't resolve? → Test DNS directly:
│ nslookup google.com 8.8.8.8
│ If this works but normal resolution doesn't → DNS server unreachable
│ or incorrect server configured
└─ Stale DNS cache? → ipconfig /flushdns (Windows)
sudo resolvectl flush-caches (Linux)
Step 4 — Check interface status
─────────────────────────────────
Windows: ipconfig /all (Media State: Connected / Media disconnected)
Linux: ip link show (look for UP and LOWER_UP flags)
┌─ Media disconnected / interface DOWN? → Physical problem
│ Check: cable seated; switch port active; NIC driver installed
└─ Interface UP but problems persist? → Suspect misconfiguration
or upstream network issue — use ping and traceroute next
11. Example Scenario — Full Diagnosis
John cannot browse the internet from his Windows laptop. He opens Command Prompt and works through the steps above.
C:\> ipconfig
Ethernet adapter Ethernet:
IPv4 Address. . . . : 169.254.34.201 ← APIPA address — DHCP failed!
Subnet Mask . . . . : 255.255.0.0
Default Gateway . . : ← No gateway (APIPA never gets one)
Diagnosis: DHCP server not responding. Check physical connection first.
C:\> ipconfig /all
...
Media State . . . . : Media connected ← Cable is plugged in
DHCP Enabled . . . . : Yes
DHCP Server . . . . : ← No DHCP server was found
Physical connection OK. DHCP server unreachable.
John checks the switch — port LED is off. He re-seats the cable.
Port LED lights up. He then runs:
C:\> ipconfig /renew
Renewing the IP address for Ethernet...
Ethernet adapter Ethernet:
IPv4 Address. . . . : 192.168.1.105 ← Valid DHCP address obtained
Subnet Mask . . . . : 255.255.255.0
Default Gateway . . : 192.168.1.1 ← Gateway restored
Internet connectivity restored. Root cause: loose cable at the switch.
12. Exam Tips & Key Points
- ipconfig is the Windows IP configuration tool; ifconfig is the legacy Linux/macOS equivalent; ip addr is the modern Linux standard.
ipconfig /allis the most information-rich Windows command — it shows MAC address, DHCP server, lease times, and DNS servers that plainipconfigomits.ipconfig /releasethenipconfig /renewforces a full DHCP cycle — release sends DHCPRELEASE; renew runs the full DORA (Discover, Offer, Request, Ack) sequence.- A 169.254.x.x address always means APIPA — the host could not reach a DHCP server. The device has no gateway and no DNS; it can only communicate with other APIPA hosts on the same segment.
ipconfig /flushdnsclears the Windows DNS cache — use it when a DNS record has been updated but the host still resolves to the old IP.- On Linux,
ifconfig -ashows all interfaces including those in the DOWN state; plainifconfigonly shows UP interfaces. - The
ipcommand replaces bothifconfig(useip addr) androute(useip route). Know both for the CCNA exam. - MAC address is labelled Physical Address in
ipconfig /alloutput and ether inifconfigoutput. - A missing default gateway means the host can ping local subnet hosts but cannot reach anything beyond the local network — a classic exam scenario.
13. Summary
| Aspect | Detail |
|---|---|
| Windows IP command | ipconfig (basic) / ipconfig /all (full detail) |
| Linux/macOS IP command | ifconfig (legacy) / ip addr show (modern) |
| DHCP release (Windows) | ipconfig /release → sends DHCPRELEASE; IP drops to 0.0.0.0 |
| DHCP renew (Windows) | ipconfig /renew → runs DORA sequence; obtains new lease |
| DNS cache flush (Windows) | ipconfig /flushdns |
| APIPA address range | 169.254.0.0/16 — assigned when DHCP fails; no gateway, no DNS |
| MAC address label | Physical Address (Windows) / ether (Linux ifconfig) |
| Show all Linux interfaces | ifconfig -a or ip addr show |
| Bring Linux interface up | sudo ifconfig eth0 up or sudo ip link set eth0 up |
| First troubleshooting step | Run ipconfig / ip addr to confirm valid IP,
mask, and gateway before any other diagnostic |