Show
In this article, I’m going to show you how to use the command-line tool ipconfig. If you’re an IT admin, ipconfig is a very useful console application program that can help you troubleshoot network connectivity problems in Windows. Table of Contents
Linux and other operating systems (OS) have similar capabilities, but they often use different commands to achieve them. Ipconfig’s Linux equivalents are considered to be ifconfig and the ip command. However, macOS uses a combination of ipconfig and ifconfig. What is ipconfig?Ipconfig is one of the most used command-line tools for analyzing, configuring and troubleshooting your systems’ network settings, both in a home or enterprise environment. It has been one of those bread and butter tools that any sysadmin and network engineer will know and treasure. Overall, this command-line tool is easy to learn and relatively easy to master. It removes the need to browse multiple different GUI-based utilities, which tend to change with every new release of Windows (annoying people like me). How to use the ipconfig commandTraditionally, ipconfig is run in a command-line session. On Windows, however, you can launch it using any of the following solutions:
If you don’t set any parameters, the ipconfig command will display the following information for all network adapters in your system:
The image below shows the output from my test server, which contains a single (virtual) network adapter. You should see something very similar on your system with the same single Network Interface Controller (NIC) configuration. Figure 1: The output from my test server (Image Credit: Michael Taschler) How to redirect the output of the ipconfig command to a text fileYou may want the output of ipconfig to be saved in a text file. This is handy for documentation. And proving that you didn’t make a mistake that brought your entire infrastructure down (I might exaggerate a tiny bit, but sometimes a small change can have a massive impact). To output the result to a text file, we’ll simply make use of the “>” (greater than) sign, something that works with many other command-line tools as well. To save the output of the ipconfig /all command to a file named ipdetailsserver1.txt, you need to run the following command: ipconfig /all > ipdetailsserver1.txt To quickly check the contents of the text file you just created, run the type command followed by the name of the file: type ipdetailsserver1.txt The image below shows the result of the export command, as well as the content of the ipdetailsserver1.txt file. Figure 2: The result of the export command to a text file (Image Credit: Michael Taschler) The top 10 ipconfig commands you should learnYou’ll find below the most important ipconfig commands that you should know and understand. As always, using your favorite search engine for help is encouraged. And many operating systems also have built-in help features explaining when and how to best use these commands. Also, I know that there are more than 10 commands but they neatly fit into ten categories. 1. Ipconfig /allAs you might have guessed, the /all parameter we used above will list all of your network adapters’ configuration information. Note that this command will begin with the Windows IP Configuration section, which includes the following six items:
Then, for each of your NICs, it will list all their settings:
Overall, this command supplies a great deal of information for troubleshooting problems. And it’s also very useful for documentation purposes. 2. Ipconfig /allcompartmentsA bit of a relic from a long time ago (Windows Vista), the /allcompartments will output the same information as the ipconfig command without any parameters. The image below shows a comparison of the outputs of the two commands. ipconfig /allcompartments Figure 3: A comparison of the output of the two commands (Image Credit: Michael Taschler) 3. Ipconfig /displaydnsThis /displaydns parameter shows the DNS resolver cache of your system. The cache cuts down on network traffic since it keeps track of IP addresses and website names you have already visited. As well as the contents (if any) of your local Hosts file. Each record contains the following sections:
ipconfig /Displaydns Figure 4: This command displays the DNS resolver cache of your system. 4. Ipconfig /flushdnsThe /flushdns parameter will flush the DNS resolver cache. This can be useful when you are troubleshooting or when you want to get rid of defective or obsolete DNS records. The cache will be repopulated as you browse the Internet or during normal system activity. A reboot of your system also flushes the DNS resolver cache. This helps to keep some privacy, but it doesn’t get rid of your browsing history. Figure 5: The Flushdns parameter flushes the DNS resolver cache 5. Ipconfig /registerdnsThe /registerdns parameter registers (or refreshes) all DHCP leases and re-registers DNS names for all your system’s network adapters. It might take some time for this to happen, but anyway, this can help to resolve problems between your system and the DNS server. Windows also registers or updates your client’s DNS registration during a reboot. ipconfig /Registerdns Figure 6: The /registerdns parameter registers the DNS resource records for all your system’s network adapters. 6. Ipconfig /releaseThis parameter only applies to network adapters that have been assigned via DHCP. The /release parameter sends a request to the DHCP server to abandon the active lease(s) and removes it (or them) from your system. Please note that if you don’t specify an adapter, then all active DHCP leases will be released. This might not be in your best interest. So, make sure that you get the syntax right. Also, if you connect remotely to a system and then release the IP address of the adapter you’re connected through, then you will terminate your active session. ipconfig /release For example, to release the IP address for a network adapter named “Ethernet0” you would need to type the following command: ipconfig /release “Ethernet0” You can also release multiple IP addresses at once by using a wildcard. To release the IP addresses of all adapters beginning with “Ether,” you would need to enter the following command: ipconfig /release Ether* For all adapters ending with “net” you would use this command: ipconfig /release *net For all adapters containing “erne” you would use this command: ipconfig /release *erne* Lastly, the /Release6 parameter is the IPv6 equivalent of /release which only releases IPv4 addresses. ipconfig /release6 7. Ipconfig /renewThis parameter renews an IP4 address. As with the release parameter, /renew applies to all your system network adapters (DHCP only). ipconfig /renew Again, the /renew6 parameter is the IPv6 equivalent of /renew which only renews IP4 addresses. ipconfig /renew6 8. Ipconfig /showclassidUser classes and vendor classes allow you to assign DHCP options to groups of clients by specifying policies that apply to some users or devices, but not all of them within the same scope. Having different classes within scopes can be useful if you want to separate a group of devices into one segment of a scope while still maintaining dynamic hosting. Classes tend to be limited to business networks. You will seldomly come across them in a home network. You could apply classes to a set of remote users to facilitate their access. Each class can contain different DNS servers, routers, gateway addresses, a time offset for your users in different time zones and specific lease times. The /showclassid parameter will display the DHCP class ID for a specified adapter. This parameter is only available only on computers with adapters that are configured to obtain an IP address automatically. Ipconfig /showclassid <adapter> To display the class information for all your systems’ network adapters, you need to enter the following command where the asterisk wildcard character replaces ‘adapter’. ipconfig /showclassid * For IPv6 addresses, you can use the /showclassid6 parameter. ipconfig /showclassid6 9. Ipconfig /setclassidThe /setclassid parameter lets you assign a class ID to one or more of your system’s adapters. To assign a class ID to all network adapters, use the following command. You’ll need to replace ‘classID’ with the actual name of your class: ipconfig /setclassid * classID You can also assign a class ID to a specific network adapter. To do so, you’ll need to replace ‘adaptername’ with the name of the specific adapter or use a wildcard, as explained earlier in this article: ipconfig /setclassid adaptername classID If no class ID is specified, then the currently assigned one is removed. For IPv6 addresses, you can also use the /setclassid6 parameter. The figure below shows the class ID named ‘policy1’ being assigned to my network adapter ‘Ethernet1’. ipconfig /setclassid Ethernet 1 policy1 Figure 7: The output of the /setclassid command (Image Credit: Michael Taschler) 10. Ipconfig /?The /? parameter displays all available commands and tips on how to best use them. You can see more details in the image below. Figure 8: The /? parameter displays all available commands and tips (Image Credit: Michael Taschler) ConclusionFrom checking your home PC’s local IP address, displaying your DNS cache, renewing your IP address, and setting a class ID, the ipconfig command will help you complete many of your networking analysis, configuration, and troubleshooting tasks and make your life a little easier. It cannot do everything, but it certainly is one of the most useful tools in your software toolbelt. What is the command to renew IP address?The ipconfig command
On a Windows computer, use the following information to release and renew your IP address: Go to "Start > Run" and type " cmd " (no quotes), then select "OK" Type " ipconfig /release " (no quotes) and press "Enter" Once the prompt returns, type " ipconfig /renew " (no quotes), then hit "Enter,"
How do I renew my IP address in Windows?Windows 10/11. Press Windows and R key at the same time to open the Run box.. Type CMD. Then, hit Enter.. Type ipconfig/release in the Command Prompt window. Press the Enter key.. Type ipconfig/renew. Press Enter.. What is ipconfig renew used for?First, ipconfig /release is executed to force the client to immediately give up its lease by sending the server a DHCP release notification which updates the server's status information and marks the old client's IP address as "available". Then, the command ipconfig /renew is executed to request a new IP address.
Which command is used for IP address?First, click on your Start Menu and type cmd in the search box and press enter. A black and white window will open where you will type ipconfig /all and press enter. There is a space between the command ipconfig and the switch of /all. Your ip address will be the IPv4 address.
|