Table of contents
- 1. Ping Command ( To check Connectivity ) 🏓
- 2. Traceroute/Tracert ( Route or path to website ) 🌍
- 3. netstat ( Network statistics ) 🚦
- 4.Curl ( Transfer data to & from server ) 🐾
- 5. dig - Domain Information groper ( DNS lookup) 🧭
- 6.ifconfig (Interface configuration) 🔄
- 7. nslookup ( Name server lookup) 🔍
- 8.Telnet ( Testing connections) ⚙️
- Conclusion🚀:
Before learning Linux, let's explore the basic networking🌍 commands that will help you troubleshoot network-related issues, to check the connectivity, port number and IP addresses to make your life much easier.
Don't worry, you'll easily learn these commands with the examples provided for simple learning.
1. Ping Command ( To check Connectivity ) 🏓
Ping is like calling your friend and saying "Hello" and getting a reply back. Use the ping command to check if you are able to communicate with another device.
Here
172.217.166.110
is the IP address of google.com and 3 packets are transmitted and received.How its useful: You can troubleshooting issues with connecting a server or device, you can figure out if there’s an issue with Internet connecting or its website issue.
2. Traceroute/Tracert ( Route or path to website ) 🌍
Traceroute is like google maps, it basically tells you the route to the destination from source. Similarly, Traceroute also shows the full path the data takes place to destination.
Traceroute - Linux or MacOs
Tracert - Windows
To install traceroute - sudo apt install traceroute
How its useful: If any issues like Timeout, then we can use the traceroute to pinpoint where the issue is exactly in the journey to destination.
3. netstat ( Network statistics ) 🚦
Netstat is like LinkedIn, where you can see connections. Netstat shows all active connections and Listening ports.
To install netstat - sudo apt install net-tools
- Here, it displays the active internet connections and indicates whether the ports are established or in a listening state.
How its useful: We can check all the connected ports and can also see if there are any suspicious connections.
4.Curl ( Transfer data to & from server ) 🐾
Curl is like bringing groceries to your mom after collecting a list of items to purchase. It's a super handy command-line tool that helps you download or upload data and interact with APIs. It also supports various protocols.
How its useful: Curl is a fast versatile tool. It automates the task by downloading or uploading.
5. dig - Domain Information groper ( DNS lookup) 🧭
Dig is like gossiping😎 with your friend to get detailed information🔍 on something. Dig is the command line tool which when entered the Domain name (like google.com) then it uses DNS to look it up to check where to send the request.
How its useful: DNS-related problems.
6.ifconfig (Interface configuration) 🔄
ifconfig is the network Interface configuration where we can view and change the network settings as well. If docker is installed, then it creates its own network interface.
Here eth0 is ethernet cable which is used to connect to any EC2 instance or server with NIC (Network Interface card).
Here 172.25.36.158 is the private IPV4 address.
Here lo is the loopback interface to locally access.
How its useful: To check the network activity, for Network troubleshooting.
7. nslookup ( Name server lookup) 🔍
Nslookup is the tool used mostly for DNS queries. It queries DNS server retrieves all the information about domain names and Ip addresses.
How its useful: It is used for troubleshooting DNS related issues and for Verifying the domain configurations.
8.Telnet ( Testing connections) ⚙️
telnet is a command-line tool used to connect to remote servers, usually to test connections on specific ports (like HTTP, FTP, or SSH).
How its useful: It’s great for diagnosing connectivity issues, especially when you're unsure if a specific service is running.
Conclusion🚀:
Understanding and learning these commands will help you check connections, IP addresses, port numbers and determine if a service is available. They are also useful for troubleshooting DNS-related issues.
Next when you have a Network-related issues in server, don’t forget these handy commands.
Happy Learning✨