ipconfig command provides basic network management functionalities about Windows operating systems like Windows Server and Windows Desktop families. With
ipconfig command IP address information about network interfaces can be listed, changed or DNS cache can be flushed. In this tutorial, we will look at these usage examples.
Display ipconfig Help
Ipconfig command uses default Windows-style parameters and syntax for help information. We will use /
h for print help. We can see that help provides useful information with the provided options and their functions.
$ ipconfig /h
All parameters about the command ipconfig are provided with the help information. Also, some short description of these options is listed.Below we will list all parameters and their description provided by ipconfig command.
/all displays TCP/IP full configuration information.
/displaydns displays the contents of the DNS client resolver cache.
/flushdns flushes and resets the contents of the DNS client resolver cache.
/registerdns initiates manual registration for the DNS names and IP addresses that are configured at a computer.
/release releases IPV4 IP addresses with DHCPRELEASE message.
/release6 releases IPv6 IP addresses.
/renew renews DHCP configuration for all adapters or specific adapter if specified.
/renew6 renews DHCPv6 configuration for all adapters or specific adapter if specified.
/setclassid configures the DHCP class ID for specific adapter.
/showclassid displays the DHCP class ID for specified adapter.
/h prints help information about ipconfig command parameters.
List All Network Interfaces and IP Addresses
Windows operating systems have more than one interface. These interfaces have information like IP, DNS, Network, etc. We can display this information with
ipconfig command without providing any parameters. This will list all interfaces and related information.
We can see that there are the following information;
- Interfaces name is the name of the given adapter in a human-readable form. In this example, it is named as
Ethernet adapter Local Area Connection
- IPv4 Address is the IP address of the given network interface in version 4. In this example, IPv4 address is
- Subnet Mask is the value used to calculate network address which is
255.255.255.0in this case
- Default Gateway is the IP address of the network gateway where communication can be done outside of the network. In this example, the default gateway address is
- Link-local IPv6 Address is the IP address in version 6.
List DNS, DHCP Server and Detailed Information
In the previous example, we have listed basic information about network interfaces. Some times this information is not enough for us. We need more detailed information like DHCP Server, DNS Server, etc. We can get these details with
> ipconfig /all
We can see that all the information about network, NIC, DHCP is provided in this case.
Lease Obtainedprovides the date the IP address is obtained from the DHCP server which is
Friday March 31 , 2017 05:08:04 AMin this case
Lease Expiresprovides the date where the IP lease will be expired. Before this date, the IP lease should be renewed in order to continue to use it. In this case, the lease expire date is
Friday March 31 , 2017 07:59:35 AM
DHCP Serveris the DHCP server IP address which is
DNS Serveris the DNS server IP address which is
Renew IP Address
DHCP is a protocol used to get an IP address and other related network information automatically. DHCP ease system and network administrators life. DHCP protocol details can get from the following tutorial
DHCP mechanism started d by client-side or a network node generally connected newly. Ipconfig command can start this mechanism with
/renew parameter. We will release our IP address if already exists and try to get a new IP address in the following example.
> ipconfig /renew
Renew Specific Network Interface IP Address
We have the option to renew the IP address of a specific Network Interface. We need to provide the whole network interface name or some part of the name with glob prefix and postfix. In this example, we will renew the IP address of interface which name contains
Con in some part of its name.
> ipconfig /renew *Con*
As another example, we can renew the IP address of the network interface which is named as
Ethernet Adapter Local Area Connection like below.
> ipconfig /renew *Ethernet*
Clear DNS Cache
One of the most faced network problems is a DNS problem. After some times using internet connection DNS cache became corrupt and can not work properly. we can connect network by can not surf the internet or get a DNS related error from the browser like Chrome, Firefox, Explorer we can try to clear DNS cache. We will clear the DNS cache with
/flushdns parameter like below.
> ipconfig /flushdns