Skip to content

ipconfig

ip addr and ip link are how Linux shows its own network configuration — those commands already appeared in the NIC article and the MAC address article. Windows answers the same question with a single, differently-named tool: ipconfig. It's worth its own article mainly because of what its /all flag exposes about the DHCP and DNS state of a machine, in a form the plain, no-flags version doesn't show at all.

Plain ipconfig versus ipconfig /all

Run with no arguments, ipconfig gives a short summary — IPv4 address, subnet mask, default gateway, per adapter:

ipconfig
Windows IP Configuration

Ethernet adapter Ethernet:

   Connection-specific DNS Suffix  . : corp.example
   IPv4 Address. . . . . . . . . . . : 192.168.1.42
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.1

That's often enough to confirm a machine has an address at all, but it hides where that address actually came from and how long it's valid — which matters the moment DHCP is even a suspect. /all shows the rest:

ipconfig /all
Ethernet adapter Ethernet:

   Connection-specific DNS Suffix  . : corp.example
   Description . . . . . . . . . . . : Intel(R) Ethernet Connection
   Physical Address. . . . . . . . . : 00-1A-2B-3C-4D-5E
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   IPv4 Address. . . . . . . . . . . : 192.168.1.42(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Lease Obtained. . . . . . . . . . : Monday, July 27, 2026 8:02:11 AM
   Lease Expires . . . . . . . . . . : Tuesday, July 28, 2026 8:02:11 AM
   Default Gateway . . . . . . . . . : 192.168.1.1
   DHCP Server . . . . . . . . . . . : 192.168.1.1
   DNS Servers . . . . . . . . . . . : 192.168.1.1
                                       8.8.8.8

Physical Address is the NIC's MAC address, in the same six-octet form covered earlier in this course, just written with dashes instead of colons — a purely cosmetic difference in Windows' formatting, not a different addressing scheme. Lease Obtained and Lease Expires are the DHCP lease timestamps directly — worth checking whenever an address seems to have changed unexpectedly, since a lease that expired without renewing (or an unusually short lease time set by an administrator) is a common, easy-to-miss reason a device's address shifts between reboots.

The four commands that actually change something

Everything above is read-only. Four more ipconfig flags take action:

  • ipconfig /release — sends a DHCPRELEASE to the DHCP server and drops the current lease. On an adapter set to obtain an address automatically, this leaves the interface without an IPv4 address until a new one is obtained.
  • ipconfig /renew — sends a fresh DHCPDISCOVER/DHCPREQUEST cycle (the same four-message exchange the DHCP article covers) and requests a new lease.
  • ipconfig /flushdns — clears the local DNS resolver cache. Useful after a DNS record changes and a stale cached answer is still being returned locally, well before that record's TTL would otherwise expire it.
  • ipconfig /displaydns — shows what's currently cached, without changing anything; worth running before /flushdns if you want to confirm a stale entry is actually the problem rather than guessing.

Warning

ipconfig /release immediately drops the adapter's IPv4 address. On a machine you're connected to remotely — over that same network adapter — this cuts your own connection before /renew gets a chance to run, since the two are separate commands and nothing guarantees the second one executes. Run /release and /renew together only on a local machine, or on a remote one with an out-of-band console (a hypervisor's own management interface, IPMI) as a fallback if the network doesn't come back.

A stale lease from before the DHCP scope changed

A laptop was on a network that's since had its DHCP scope reconfigured to a new subnet, but the laptop is still showing an address from the old range and can't reach anything on the new one. Its lease simply hasn't expired yet — Windows doesn't proactively check whether a DHCP server's configuration changed underneath an active lease it's already holding.

ipconfig /release
ipconfig /renew
Windows IP Configuration

Ethernet adapter Ethernet:

   Connection-specific DNS Suffix  . : corp.example
   IPv4 Address. . . . . . . . . . . : 10.0.5.87
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 10.0.5.1

Forcing a fresh DHCPDISCOVER gets an address from the new scope immediately, rather than waiting out however many hours remained on the stale lease. This is a narrower, faster fix than rebooting the machine, which would eventually trigger the same renewal but by restarting the whole networking stack to get there.

Practice exercises

  1. Run ipconfig /all on a Windows machine and identify the DHCP lease's Lease Obtained and Lease Expires timestamps — how long is the configured lease duration?
  2. A user reports "the internet stopped working" right after their ISP's router was replaced. Using the scenario above as a model, explain why ipconfig /release followed by /renew is a reasonable first step, and what specifically it fixes if the problem is DHCP-related.
  3. Explain why ipconfig /flushdns clearing a stale cached record only helps locally — what would still need to happen for every other machine on the internet still caching that same stale answer?

Linux answers the same "what's my own configuration" question with a completely different command — one that also replaced an older tool of its own, the way ss replaced netstat in the previous article.

Sources