In Windows Operating system, they have some useful networking command to use in command line to troubleshoot network or get information about network issue. I will explain 4 very useful command in windows command prompt. To access into command prompt on Windows10, go to windows search box, type ‘cmd’ and press enter.
- ipconfig command:
Our first command is ipconfig. This is very useful command to check IP information. Use the parameter /all to see the DNS settings as well. SO it will display our IP address, Subnet mask, gateway address and DNS address. It will also display if our cable is plugged in or disconnected. We can also get the information about our DHCP server. The gateway address you see in the figure, is our router address. So this is very helpful to gather all the information about IP to troubleshoot further.
- ipconfig /all – This command will display detail information of IP including DNS and DHCP server address.
- ipconfig /renew – Renew DHCP address
- ipconfig /release – Release current DHCP address
- ipconfig /flushdns – Flush DNS cache
Our next command is ping. Ping is very common and frequent command a network troubleshooter use in their daily job. We type ping with target host IP address or website address. Ping is used to check the reachability of a host. Ping operates by sending ICMP Echo message to target host and waiting for ICMP Echo reply. By default ping will try 4 times. So basically we are sending a signal to another device, and if the device is active, it will response back to the sender, if not then we will get request timed out or destination unreachable message. We can ping to website address or FQDN such as ping google.com, if we see we get response, it means our DNS setting and internet is okay. I always check with Google public DNS address 22.214.171.124 to see if my internet is okay.
ping google.com or ping 192.168.1.1
- tracert command:
Now we move into the next command. Our next command is tracert command. The syntax is tracert with target host or website address. This is actually traceroute command but in Windows we type it as tracert. Trace route is network diagnostic tool for displaying the route (path) and measuring transit delay of packets across the IP network. When we traceroute to any server such as google server, we will see how many routers it actually cross to reach the destination. The number along with path is shows, also called hops. So we will get clear picture of how many hops it crosses to reach google. It is helpful for ISP engineers to troubleshoot network delay issues. They may change the route path then to get better latency.
- nslookup command:
Let’s move into our final command. Our final command is nslookup command. Nslookup command collects the DNS records for a domain or ip address. For a particular website, an IP address and domain names are stored in DNS servers. So when we query domain by this nslookup command, it will tell us if the domain is resolved by our local DNS server and it will also tell us the IP address of the given domain name.