Use the ipconfig command to troubleshoot network problems
In the world of networking IP addresses are everything and if you don’t have one then it will be very difficult to communicate with other devices on your network or on the Internet. This is why IP address management is very important and knowing how to troubleshoot IP address issues will help you avoid frustration and possible expenses down the line.
IP addresses are used to by devices on a network to connect to other devices on that network. Think of it as your house address and the mailman needs to deliver a package, or packet in the networking world. He or she will use your house address to route the package to the correct destination. All public IP addresses are unique so you don’t have to worry about your packets going to the wrong computer. Private IP addresses can be used for multiple devices but not on the same network. On your internal network one location can have the same internal IP addresses as a separate unrelated location but you can’t have the same IP address on the same internal network otherwise there will be a conflict.
IP addresses can be static or dynamic. A static IP address is manually assigned by you or your network administrator. A dynamic IP address is assigned automatically by a DHCP server. A DHCP server can be a Windows, Linux or UNIX computer etc. or it can also be built into a firewall or router like the one you use at home.
If you want to be able to check your IP address settings on a Windows computer you will need to know how to use the ipconfig command. Linux and other operating systems have their own versions of the command such as ifconfig. The ipconfig command has various options called switches that you can use to get specific information about you IP configuration. Some are more useful than others and some are meant for more advanced troubleshooting. We will go over the ones that are most commonly used by your average network administrator or even home users.
To get to ipconfig you will need to open a command prompt and there are several ways to do this. The easiest way is just to click on Start and type cmd and press enter. This can also be done from Cortana on Windows 10. Once you are there you will have a blank command prompt and now you can start playing with ipconfig. To get to the help section that shows the switches and examples type in ipconfig /? and press enter.
As you can see there are many switches you can use to perform a variety of tasks so we will now go over a few of the more commonly used ones. But first let’s find out what kind of information you get just by typing in ipconfig by itself.
As you can see you pretty much just get the basics such as the IPv4 and IPv6 IP address, subnet mask and default gateway.
But when we add the /all switch we get some additional information such as the host name (computer name) and the network adapter name. We can also see that the client is DHCP enabled meaning that it will go out and look for a DHCP server on startup to get an IP address and that autoconfiguration is also enabled. We also get the MAC address of each network adapter which is also referred to the hardware address. This is a burned in unique address assigned just for that card and is also used in network communications. Another important bit of information we get with the /all switch is the DHCP and DNS server addresses. This can come in real handy when troubleshooting connectivity and name resolution problems.
Now let’s talk about some of the other more commonly used switches. If you need to get a different IP address via DHCP for some reason you can use the /release and /renew switches where /release will drop the IP address from your network adapter and then the /renew switch will have the DHCP service go out and contact the DHCP server to get another IP address. Keep in mind that a lot of the time you will end up with the same IP address if it’s still available.
The /displaydns switch will show you the entries in your DNS resolver cache which stores DNS information about hosts that you have resolved online and on the network as well as any entries stored in your local hosts file. Running this command will most likely scroll a very long list of entries so you can press Ctrl-C to stop the command from running. You can always pipe the command to more to get one page at a time. The command to do that would look like this ipconfig /displaydns | more. Then you would press the spacebar to get to the next page or enter to get to the next line.
The /flushdns command is used to clear out the contents of the DNS resolver cache. You may encounter an issue where you are trying to access a network resource or website that has had its name changed and your computer is still trying to resolve it to the old name. This is where flushing your DNS cache is handy because it will clear out all that old information as well as any other DNS information it has stored.
The last switch we will discuss is the /registerdns switch which will register your computer with your DNS server. When your computer is first brought online on a network it is supposed to register itself with your DNS server. Sometimes this doesn’t work for some reason or if you rename your computer you might want to re-register it with your DNS server. This is where the /registerdns command comes in handy.
As you can see the ipconfig command is a useful tool for network troubleshooting and diagnostics and you can obtain a lot of useful information if you use the right switches to do so.