Ipconfig - DOS/Command Prompt Reference
[Windows NT series/XP or later] Displays the IP address assigned to the network adapter and performs related operations.
Syntax
ipconfig[.exe] [/allcompartments] [/all | /renew [<adapter>] | /renew6 [<adapter>] | /release [<adapter>] | /release6 [<adapter>] | /flushdns | /displaydns | /registerdns | /showclassid <adapter> | /showclassid6 <adapter> | /setclassid <adapter> [<classid>] | /setclassid6 <adapter> [<classid>]]
* Options other than /allcompartments can be used individually (or none at all).
Options
<adapter> | For each option, specifies the network adapter name with <adapter>. The adapter name corresponds to the name displayed in ‘Network and Sharing Center’ → ‘Change adapter settings’ in the Control Panel. (It is also possible to change the name from there.) |
/allcompartments | [Windows Vista or later] Operates on all network compartments (displays information or changes settings). |
/all | Outputs detailed information for each adapter. If /all is not specified, it will output information such as IP addresses and default gateways. |
/renew [<adapter>] |
Refreshes the assigned IP address (IPv4) for <adapter>. In the case of automatic allocation, a different address may be assigned than before. If <adapter> is omitted, it refreshes the addresses for all available adapters. |
/renew6 [<adapter>] | [Windows Vista or later] Similar to /renew, but refreshes IPv6 addresses. |
/release [<adapter>] | Releases the assigned IPv4 address for <adapter>. After releasing, a temporary IP address may be assigned until refreshed with `/renew`. |
/release6 [<adapter>] | [Windows Vista or later] Similar to /release, but releases IPv6 addresses. |
/flushdns | Purges the DNS resolver cache. This is used when you want to query the DNS server again for the address of a domain name. |
/displaydns | Displays a list of the contents of the DNS resolver cache. Since it shows all cached domain names, the output may be extensive. |
/registerdns | Performs a re-registration of client information (DNS names) registered with the DNS server. Administrative privileges are required to execute this command. |
/showclassid <adapter> | Displays all DHCP class IDs assigned to the client of <adapter>. Use /setclassid to configure. |
/showclassid6 <adapter> | [Windows Vista or later] Similar to /showclassid, but displays DHCPv6 class IDs. |
/setclassid <adapter> [<classid>] | Sets the DHCP class ID for the client of <adapter>. The class ID must be one recognized by the DHCP server. If <classid> is omitted, it can be set to none. Administrative privileges are required to execute this command. |
/setclassid6 <adapter> [<classid>] | [Windows Vista or later] Similar to /setclassid, but it sets the DHCPv6 class ID. Administrative privileges are required to execute this command. |
Details
Ipconfig mainly provides functionality related to network adapters, including the following:
- Displaying, renewing, and releasing the current values of IP addresses (no option, /all, /renew, /renew6, /release, /release6)
- Operations related to DNS (/flushdns, /displaydns, /registerdns)
- Configuring DHCP class ID (/showclassid, /showclassid6, /setclassid, /setclassid6)
Ipconfig can be used to check whether the adapter is functioning properly and perform basic maintenance when unable to connect to the network or the internet.
Samples
Sample 1
ipconfig /renew Wi-Fi
Refreshes the IPv4 address assigned to the adapter named ‘Wi-Fi’.
Sample 2
ipconfig /flushdns
Clears the DNS resolver cache, forcing new address queries when resolving hostnames for subsequent connections.