Basic & Important Networking Commands one should know.
Networking as a subject/technology provides many commands to play with. In this blog, I have mentioned a series of basic and Important commands that everyone should know in general and are also important while attending interviews where networking-based questions have a good amount of weightage. Let's just start.
What does ping mean in general? Let’s say when a friend says he or she will ping you, what does it mean? In chat language to ping, someone means to send a short and quick message to someone. We either ping on phone to initiate a conversation or to check if the person on the other side is available or not. That’s exactly how the ping command works in networking. Ping basically helps you to check if our system is connected to a local area network or if our system is connected to the internet. So here comes a question. Whom do we ping?. Using the ping command you can ping the IP Address of the host, where the host can be computer/server/router, etc on a local area network or on the internet. The ping utility usually sends 4 data packets to the IP Address specified and our computer waits for the response and the server sends the data packet back to us a reply. These replies are called “Echo Reply Requests”. Replies tell us that there is network connectivity between us and the server. Ping uses the ICMP protocol to check whether a system is connected to the internet or not. We’ll discuss protocols in a different blog.
Here we are pinging the domain icann.org
In general ping command is used to troubleshoot networking issues, such as network connectivity
This command helps us to see the exact path that the data packet is taking in order to reach the destination. Why is it important to know the path?. When a data packet is sent from our address to the destination address there are many network devices in between through which these packets move forward. So if there is an issue in network connectivity we can trace the path and understand which device in the middle is causing the issue.
Different hops show different network devices the data goes through in order to reach the destination
tracert is used in windows based systems whereas traceroute is used in UNIX OS.
This command is basically used to fetch the DNS records for a given domain name or IP Address. IP addresses and domain names are stored in DNS servers, and this command lets us query the DNS records to gather information. By the way, what is DNS?. DNS stands for Domain Name System. As per google a simple definition for DNS is that it is a phonebook of the internet. So what does a phonebook consist of? It consists of the names of people along with their phone numbers. In a similar fashion, every domain name we see has its own unique IP Address. For example, everyone knows this famous domain name “google.com” the public DNS IP Address for this domain is “22.214.171.124”. Why do we need domain names when we have IP Addresses? I’ll let you answer this question. Think!
nslookup/ nslookup hostname / nslookup IPAddress
Performing nslookup on a domain name
Performing nslookup on an IP Address
This command displays the IP Address configuration of our system. The information displayed using this command is IP Addresses(IPv4 and IPv6 both), Default Gateway, and the Subnet Mask. One can add the /all after ipconfig to get DNS-related information and other details of IP Address such as leases and accessing the home router etc.
ipconfig (or) ipconfig /all
This is not a networking command to be precise but is a very important command to know about the configurations in our device. The command tells you about hostname, OS, OS name, manufacturer, system model, type, BIOS version, NIC cards, etc. It also speaks about the amount of memory available and the amount of memory in use( Both physical and Virtual Memory).
As the name suggests netstat means “network statistics”. This command lists out the TCP & UDP sockets. We can check for open ports, active ports, or the ports on which our system is listening. We even get to see routing table information. We have different options on netstat like netstat -a that gives us a list of active ports on our system, netstat -r displays the IP routing table. You can lookout out for different other options and explore this command further.
Before knowing about the arp command we need to know what arp is. arp is abbreviated as “Address Resolution Protocol”. It is a communication-based protocol for discovering MAC Addresses of devices when we know the IP Addresses for the same. What is MAC Address?. It is a unique physical address using which we can recognize devices over the network. How is IP Address different from MAC Address?. A simple analogy will answer this question for you. If IP Address is your home address( Your House) then MAC Address is your name. We’ll speak more about ARP in other blogs, for now, let's just go back to the command. The arp command is used to see and modify the details in the arp table. The table consists of MAC addresses along with the IP addresses of the devices that our device came in contact with within the local network. But why do we need a table for ARP? Think!
These are some basic commands that I wanted to highlight in this blog. Do check them out by typing them in your machine and enjoy the practical learning. More blogs are on the way. Stay Home, Stay Safe, Happy Learning!.