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.
Ipconfig command uses default Windows style parameters and help syntax. We will use /
h for print help. We can see that help provides useful information with the provided options and their functions.
$ ipconfig /h
List Network Interfaces and IP Addresses
Windows operating systems have more than one interfaces. 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 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 `192.168.122.1`
- Subnet Mask is the value used to calculate network address which is `255.255.255.0` in 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 `192.168.122.1`
- 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 Obtained` provides the date the IP address is obtained from the DHCP server which is `Friday March 31 , 2017 05:08:04 AM` in this case
- `Lease Expires` provides the date where IP lease will be expired. Before this date, the IP lease should be renewed in order to continue to use. In this case, the lease expire date is `Friday March 31 , 2017 07:59:35 AM`
- `DHCP Server` is the DHCP server IP address which is `192.168.122.1`
- `DNS Server` is the DNS server IP address which is `192.168.122.1`
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 command like below.
> ipconfig /flushdns