ipconfig - Check IP Address

Maintained on

The ipconfig command is a basic Windows command for checking network settings and performing DHCP- and DNS-related operations.

Because it shows the IP address, subnet mask, default gateway, DNS cache and more, it is often the first command to run when narrowing down a network problem.

ipconfig command syntax

ipconfig
ipconfig [/allcompartments] [/all] [/renew [<adapter>]] [/release [<adapter>]] [/renew6 [<adapter>]] [/release6 [<adapter>]] [/flushdns] [/displaydns] [/registerdns] [/showclassid <adapter>] [/setclassid <adapter> [<class ID>]]
When the adapter name contains spaces

If the adapter name contains spaces, enclose it in quotation marks, such as "Ethernet 2". Some options also accept the wildcard *.

Start by running ipconfig

ipconfig
- □ ×
Command Prompt Icon
Command Prompt
Microsoft Windows [Version xx.x.xxxxx.xxx]
(c) 2026 Ribbit App Development All rights reserved.
 
C:\users\user>ipconfig
Windows IP Configuration
Ethernet adapter Ethernet:
IPv4 Address… … … . . : 192.168.1.2
Subnet Mask … … … . . : 255.255.255.0
Default Gateway … … … : 192.168.1.1
C:\users\user>

This output alone usually gives you an overview of the network you are currently connected to.

ipconfig shows local information

ipconfig shows local settings such as the private IP address assigned to your PC. To find the global IP address visible from the internet, check your router’s admin page or an external lookup service.

Extracting only the IPv4 address

When the output is long, combine it with the findstr command to show only the lines you need.

ipconfig | findstr /i "IPv4"

The | (pipe) passes the output of the command to findstr, which filters it.

Common options

OptionDescription
/allShows detailed information for all adapters
/displaydnsShows the DNS client resolver cache
/flushdnsClears the DNS client resolver cache
/registerdnsRe-runs dynamic registration of DNS names and IPs
/releaseReleases the IP configuration obtained via DHCP
/renewRenews the IP configuration obtained via DHCP

/all - Show detailed information

ipconfig /all

With /all, the output also includes the MAC address (“Physical Address”), whether DHCP is enabled, DNS servers and the lease times. It is also handy for finding a MAC address.

/displaydns - Check the DNS cache

ipconfig /displaydns

Useful when you want to see which IP address a DNS name has been resolved to.

/flushdns - Clear the DNS cache

ipconfig /flushdns

Use it when outdated name resolution results may be cached. On success, “Successfully flushed the DNS Resolver Cache.” is displayed.

Administrator privileges required

Options that change settings, such as /flushdns, /registerdns, /release and /renew, must be run in a Command Prompt opened as administrator. Without privileges, an error is displayed.

/registerdns - Re-register with DNS

ipconfig /registerdns

This is not a command that refreshes the DNS client cache. It re-runs the dynamic registration of the DNS name and IP address configured on the PC.

/release / /renew - Obtain a DHCP address again

ipconfig /release
ipconfig /renew

Use these when you want to obtain an IP address again in a DHCP environment. /release temporarily disconnects the network, so do not run it on a PC you are connected to remotely.

Not for fixed-IP adapters

/release and /renew are for adapters that obtain their address automatically via DHCP. They do not behave as expected on adapters with a fixed IP.

Using it for troubleshooting

1. Check the current settings first

ipconfig /all

Check that the IP address, gateway and DNS servers are what you expect.

2. If name resolution looks wrong, check / clear the DNS cache

ipconfig /displaydns
ipconfig /flushdns

3. If DHCP seems to be the problem, obtain the address again

ipconfig /release
ipconfig /renew
Commands to use together

After checking the settings with ipconfig, use ping to check reachability of the gateway or an external host, and netstat to check connection status, to narrow down the cause.

In preparation
The linked page is currently under construction. Please wait a moment.

Quiz

Practice Problem

Which option clears the DNS client resolver cache?

回答がサーバーに送信されることはありません
Practice Problem

Which statement correctly describes ipconfig /renew?

回答がサーバーに送信されることはありません
#Command Prompt #Batch Files #ipconfig #Network #Commands