On Windows operating systems, the ipconfig utility is used to get different information about the current TCP/IP protocol settings, release or renew the IP address assigned from a DHCP server, etc. This is one of the most common utilities for troubleshooting network connection problems in Windows (as well as ping, net, netstat, nslookup, tracert, pathping, arp, route).
In this article, we will show how to get information about the current IP address of a computer using the ipconfig utility, how to obtain an IP address from the Dynamic Host Configuration Protocol (DHCP) server or release it.
To get current TCP/IP configuration of the local interface of the computer, including the IP address, subnet mask, gateway IP address, DNS servers IP addresses, domain suffix, open a command prompt as an administrator and run the command:
An example of the displayed network adapter configuration:
It also provides information about each network adapter installed in the system, as well as information about the DHCP service (and DHCP server) or about static IP addressing.
In this example, you can see that the current IP address for the network adapter Ethernet adapter Ethernet0 (Intel(R) 82574L Gigabit Network Connection): 192.168.72.1.
IPv4 Address. . . . . . . . . . . : 192.168.72.1(Preferred)
The fact that this network adapter is allowed to obtain the dynamic IP address from a DHCP server is indicated by the line:
DHCP Enabled. . . . . . . . . . . : Yes
Please note that the address is assigned by the DHCP server 192.168.72.254.
DHCP Server . . . . . . . . . . . : 192.168.72.254
The Lease Obtained field indicates the time of obtaining this dynamic IP address from a DHCP server, Lease Expires—the expiration date of the lease.
Lease Obtained. . . . . . . . . . : Wednesday, March 6, 2019 7:42:01 AM
Lease Expires . . . . . . . . . . : Wednesday, March 6, 2019 8:26:49 AM
To release the IP settings of all network adapters of the computer, use the command:
When executing this command, the client sends a DHCPRELEASE packet to the DHCP server, indicating that the client no longer needs to use its network address. All active TCP/IP connections for all network adapters are terminated and the client release the IP address (the computer is disconnected from the Internet in this time).
Or you can reset the IP address for a specific network adapter only. If the adapter name contains spaces, its name must be specified in quotes. You can also use wildcards * and ?. For example:
ipconfig /release *Ethernet0*
In order to renew IP Address from DHCP server you need to run the command:
As with the release option, ipconfig /renew can accept the optional attribute—the name of the network connection.
Both the /renew and /release options work only on clients configured to automatically obtain dynamic IP addresses from a DHCP server (this could be your router or ISP equipment). Updating the IP address will usually resolve problems connecting to a new network or a new router.
In various scripts or when connecting remotely via RDP, you can use the following one-liner to release and renew the IP address for all network adapters:
ipconfig /release && ipconfig /renew
- How to Fix Your PC Ran Into a Problem and Needs to Restart? - August 9, 2020
- How to Perform a RAM Check in Windows 10? - August 9, 2020
- How to Migrate DHCP Server to Windows Server 2016/2019? - August 7, 2020