Networking & Diagnostics10 min read

    Using the Windows ipconfig command

    By AmirReliability & Network Engineering
    Share

    ipconfig is the built-in Windows utility for viewing and manipulating per-adapter IP configuration. It answers everyday questions like "what IP did DHCP give me?", "why is the browser still hitting the old server?", or "is this NIC even getting a lease?" — without installing anything.

    It ships with every supported version of Windows (client and Server) and runs from cmd.exe, PowerShell, or Windows Terminal. Most read-only commands work as a normal user; commands that change state (release/renew, flush DNS, register DNS) require an elevated prompt.

    This guide covers the flags you will actually use, how to read the output, and the recipes that solve the most common networking problems on Windows.


    Where to run it

    ipconfig is a console program in C:\Windows\System32\ipconfig.exe, so it works the same in:

    • cmd.exe
    • PowerShell (Windows PowerShell 5.1 and PowerShell 7+)
    • Windows Terminal
    • A remote winrs / WinRM session

    For anything that modifies state — /release, /renew, /flushdns, /registerdns, /setclassid — open the prompt with Run as administrator. Read-only output (ipconfig, ipconfig /all, ipconfig /displaydns) does not require elevation.

    PowerShell users: the modern, scriptable equivalents are Get-NetIPConfiguration, Get-NetIPAddress, Get-DnsClientCache, and Clear-DnsClientCache. They return objects you can filter and pipe. ipconfig is still the fastest way to eyeball state interactively, which is why it remains the first tool reached for during incident triage.


    The flags you will actually use

    Command What it does
    ipconfig Short summary: per-adapter IPv4 address, IPv6 address, subnet mask, default gateway.
    ipconfig /all Full configuration: hostname, MAC, DHCP server, DHCP lease times, DNS servers, WINS, suffix search list, NetBIOS state.
    ipconfig /release Release the IPv4 DHCP lease on all adapters.
    ipconfig /release "Ethernet" Release the lease on a specific adapter.
    ipconfig /release6 Release the IPv6 (DHCPv6) lease.
    ipconfig /renew Request a new IPv4 DHCP lease.
    ipconfig /renew6 Request a new IPv6 (DHCPv6) lease.
    ipconfig /flushdns Empty the local DNS resolver cache.
    ipconfig /displaydns Print the current DNS resolver cache (cached records and negative responses).
    ipconfig /registerdns Refresh DHCP leases and force dynamic DNS re-registration of all adapters.
    ipconfig /showclassid <adapter> List the DHCP class IDs configured on the adapter.
    ipconfig /setclassid <adapter> [classid] Set (or clear) the DHCP class ID.
    ipconfig /allcompartments Show configuration across all routing compartments (rarely needed; useful with VPN/UAG setups).
    ipconfig /allcompartments /all Combined — full detail across all compartments.
    ipconfig /? Built-in help.

    Adapter names with spaces must be quoted: ipconfig /renew "Wi-Fi". Wildcards are accepted: ipconfig /renew Eth*.


    Reading the output

    ipconfig (short form)

    Windows IP Configuration
    
    Ethernet adapter Ethernet:
    
       Connection-specific DNS Suffix  . : corp.example.com
       IPv4 Address. . . . . . . . . . . : 10.0.0.42
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Default Gateway . . . . . . . . . : 10.0.0.1
    

    Each connected adapter prints a block with its IPv4 address, mask, gateway, and (if assigned) IPv6 addresses. Disconnected adapters show Media disconnected. Tunnel pseudo-adapters (isatap.*, Teredo) usually appear too — ignore them unless you are explicitly debugging IPv6 transition.

    ipconfig /all

    Windows IP Configuration
    
       Host Name . . . . . . . . . . . . : web-01
       Primary Dns Suffix  . . . . . . . : corp.example.com
       Node Type . . . . . . . . . . . . : Hybrid
       IP Routing Enabled. . . . . . . . : No
       WINS Proxy Enabled. . . . . . . . : No
    
    Ethernet adapter Ethernet:
    
       Connection-specific DNS Suffix  . : corp.example.com
       Description . . . . . . . . . . . : Intel(R) Ethernet Connection I219-V
       Physical Address. . . . . . . . . : 00-1A-2B-3C-4D-5E
       DHCP Enabled. . . . . . . . . . . : Yes
       Autoconfiguration Enabled . . . . : Yes
       IPv4 Address. . . . . . . . . . . : 10.0.0.42(Preferred)
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Lease Obtained. . . . . . . . . . : Friday, May 9, 2026 09:14:02
       Lease Expires . . . . . . . . . . : Saturday, May 10, 2026 09:14:02
       Default Gateway . . . . . . . . . : 10.0.0.1
       DHCP Server . . . . . . . . . . . : 10.0.0.1
       DNS Servers . . . . . . . . . . . : 10.0.0.2
                                           1.1.1.1
       NetBIOS over Tcpip. . . . . . . . : Enabled
    

    The fields you care about most:

    • Physical Address — the adapter's MAC; used to identify it on the switch / DHCP server.
    • DHCP EnabledYes means the IP came from DHCP, No means it is statically configured.
    • IPv4 Address (Preferred)Preferred confirms the lease is currently valid.
    • Lease Obtained / Expires — useful for confirming a renew actually happened.
    • DHCP Server — which server handed out the lease (matters when there are rogue DHCP servers).
    • DNS Servers — the resolvers Windows will use, in order.

    ipconfig /displaydns

    Each cached entry looks like:

        api.example.com
        ----------------------------------------
        Record Name . . . . . : api.example.com
        Record Type . . . . . : 1
        Time To Live  . . . . : 137
        Data Length . . . . . : 4
        Section . . . . . . . : Answer
        A (Host) Record . . . : 198.51.100.10
    
    • Record Type 1 = A, 5 = CNAME, 28 = AAAA, 15 = MX. Negative cache hits show Section: Authority and no Answer record.
    • Time To Live is the remaining TTL in seconds, counting down. A flush resets the cache; entries reappear as Windows resolves names again.

    Practical recipes

    Find your current IP, gateway, and DNS

    ipconfig
    

    Or for the full picture (MAC, DHCP server, lease times):

    ipconfig /all
    

    Force a fresh DHCP lease

    ipconfig /release
    ipconfig /renew
    

    To target only one adapter (for example, leave the VPN tunnel alone):

    ipconfig /release "Ethernet"
    ipconfig /renew "Ethernet"
    

    For dual-stack environments, repeat with the IPv6 variants:

    ipconfig /release6
    ipconfig /renew6
    

    Confirm the renew worked by checking Lease Obtained in ipconfig /all — it should now reflect the current time.

    Fix stale DNS resolution

    After a DNS change (TTL too long, wrong record cached, switching VPN profiles):

    ipconfig /flushdns
    

    Verify the cache is empty:

    ipconfig /displaydns
    

    You should see Could not display the DNS Resolver Cache. followed by an empty list, or just the boilerplate header. Note that browsers (Chrome, Firefox, Edge) keep their own DNS caches — flushing the OS cache does not clear them. Restart the browser or use its internal flush page (chrome://net-internals/#dns).

    Identify which adapter is which

    ipconfig /all | findstr /i "adapter Physical"
    

    Cross-reference the Physical Address with the MAC printed by your switch port or VM platform. This is the fastest way to tell Ethernet from Ethernet 2 after you renamed an adapter.

    Diagnose APIPA addresses (169.254.x.x)

    If ipconfig shows an IPv4 address in 169.254.0.0/16, the client failed to reach a DHCP server and self-assigned an Automatic Private IP. Try:

    ipconfig /release
    ipconfig /renew
    

    If renew still fails (The operation failed as no adapter is in the state permissible for this operation), the link is down or no DHCP server is responding — investigate the cable, VLAN, or DHCP scope.

    Inspect the DNS cache for a specific name

    ipconfig /displaydns | findstr /i "api.example.com"
    

    Useful for confirming whether a name is being resolved at all, and what TTL Windows sees. If you see a negative cache entry (Name does not exist) for a name that should resolve, flush the cache and re-test.

    Re-register A records in AD-integrated DNS

    After moving an AD-joined server, or after the dynamic DNS update silently failed:

    ipconfig /registerdns
    

    This refreshes the DHCP lease on every adapter and instructs the DNS Client service to re-register the host's A (and PTR, if reverse zones allow updates) record with the configured DNS servers.

    Cross-check on multi-adapter / VPN hosts

    ipconfig /allcompartments /all
    

    Useful when a VPN client (DirectAccess, some third-party clients) puts the tunnel into a separate routing compartment. Plain ipconfig /all only shows compartment 1; the /allcompartments form reveals the rest.


    Operational tips

    • Run elevated for state-changing commands. release, renew, flushdns, registerdns, and setclassid all need an Administrator prompt. The error you get otherwise is The requested operation requires elevation.
    • /flushdns only flushes the OS cache. Browsers, JVMs, and some long-running services cache independently. After a DNS change, restart the affected process too.
    • /displaydns is empty when the DNS Client service is stopped. Some hardening guides disable it; if you see "Could not display the DNS Resolver Cache" on every host, check Get-Service Dnscache.
    • Static IPs ignore release / renew. Those commands only act on adapters with DHCP Enabled: Yes. If the adapter is statically configured, change the IP via Set-NetIPAddress, the GUI, or netsh.
    • Adapter names are localized. On a German Windows install, the adapter is Ethernet, not Local Area Connection. Use ipconfig with no arguments to see the actual names before scripting release/renew against them.
    • ipconfig shows configuration, not connectivity. A clean ipconfig /all does not mean the gateway is reachable — pair with ping, Test-NetConnection, or tracert to confirm reachability.
    • For scripts, prefer the PowerShell cmdlets. Get-NetIPConfiguration and friends emit objects; parsing ipconfig text is fragile across locales and Windows versions.

    Troubleshooting

    • The requested operation requires elevation. — open cmd or PowerShell with Run as administrator and re-run.
    • The operation failed as no adapter is in the state permissible for this operation. — every adapter is either disconnected, statically configured, or already released. Check ipconfig /all for the adapter's state before retrying.
    • No operation can be performed on Ethernet while it has its media disconnected. — link is down. Reseat the cable, re-enable the adapter, or check the virtual switch.
    • /renew hangs for ~30 seconds, then fails. — no DHCP server is replying on the segment. Check the DHCP scope, VLAN tagging, and ipconfig /all's DHCP Server field after the failure.
    • /flushdns says success but stale records still resolve. — the stale answer is cached somewhere else (browser, application, upstream resolver, hosts file). Inspect C:\Windows\System32\drivers\etc\hosts and the application's own cache.
    • ipconfig /all shows two IPv4 Address lines on one adapter. — a secondary IP is bound (intentional for hosting multiple sites, or left over from a previous configuration). Use Get-NetIPAddress -InterfaceAlias <name> to see all bindings cleanly.
    • ipconfig /registerdns succeeds but DNS still has the old record. — the zone may be configured to not accept dynamic updates from non-secure clients, or the record is owned by another host. Check the DNS Manager ACL on the record.

    Summary

    ipconfig is small, always present, and answers most "what is this Windows host's network state?" questions in seconds. The minimum-viable mental model:

    1. ipconfig to see addresses and gateway, ipconfig /all when you need MAC, DHCP, lease times, or DNS servers.
    2. /release + /renew (elevated) to bounce a DHCP lease.
    3. /flushdns (elevated) when DNS changes are not taking effect — and remember browsers cache separately.
    4. /displaydns to see what the resolver currently believes, including negative cache entries.

    Anything more script-friendly belongs in PowerShell (Get-NetIPConfiguration, Get-DnsClientCache, Clear-DnsClientCache), but for fast triage on a console — local or remote — ipconfig is still the right first move.