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 *.

Quick reference

GoalCommand
Check your IP addressipconfig
Check the MAC address and DNS serversipconfig /all
Remove stale name-resolution resultsipconfig /flushdns (administrator)
Obtain an IP address from DHCP againipconfig /release then ipconfig /renew (administrator)

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.

Extracting only the MAC address

The MAC address appears on the “Physical Address” line of ipconfig /all. Filtering with findstr makes it easy to find.

ipconfig /all | findstr /i "Physical"
Display language

The item names depend on the Windows display language. On a Japanese system, search for 物理アドレス instead. If you only need a list of MAC addresses, the getmac command also works.

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.

To target only one adapter, specify its name.

ipconfig /release "Wi-Fi"
ipconfig /renew "Wi-Fi"
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.

When the IP address is 169.254.x.x

If the IPv4 address shown by ipconfig starts with 169.254., the PC could not obtain an address from a DHCP server and Windows assigned an APIPA (Automatic Private IP Address) instead. This address cannot be used to reach the router or the internet.

Check the following in order.

  1. Check the LAN cable or Wi-Fi connection and the router’s power
  2. Obtain the address again with ipconfig /release and ipconfig /renew
  3. If nothing changes, restart the router or the PC

Quiz

Practice Problem

Which option clears the DNS client resolver cache?

Choose one answer.

  1. /displaydns
  2. /flushdns
  3. /registerdns

Practice Problem

Which statement correctly describes ipconfig /renew?

Choose one answer.

  1. Renews the IP configuration obtained via DHCP
  2. Lists the DNS cache
  3. Checks port usage
#Command Prompt #Batch Files #ipconfig #Network #Commands