🌐 CMD Commands Used in Networking 

🖥 1️⃣ ipconfig

📖 Purpose

Shows the computer’s IP address, Subnet Mask, and Default Gateway for each network adapter (Wi-Fi, Ethernet, etc.).

It helps you:

  1. See your IP address, gateway, subnet mask.
  2. Reset or renew your IP.
  3. Fix DNS-related problems.

🔧 Practical Usage

✅ 1. Check IP Configuration

ipconfig

Used to verify:

  • IP Address
  • Subnet Mask
  • Default Gateway

👉 Helps confirm whether system received valid IP.

✅ 2. Detailed Information

ipconfig /all

Shows:

  • Physical (MAC) address
  • DHCP enabled or not
  • DNS server
  • Lease time

👉 Used in troubleshooting DHCP & DNS issues.

✅ 3. Release IP Address

ipconfig /release

Releases current DHCP IP address.

👉 Used when system has wrong IP or conflict.

✅ 4. Renew IP Address

ipconfig /renew

Requests new IP from DHCP server.

👉 Used when system shows APIPA (169.254.x.x).

🌐 2️⃣ ping

📖 Purpose

  • Tests connectivity between your device and another device.
  • It is used to test the connectivity, whether my device is able to communicate to the other devices or not
  • Getting the reply – ensures the proper connection with the other device
  • Not getting the reply  – Network problem (device is unreachable, off or blocked)

 

🔧 Practical Usage

ping 8.8.8.8
ping google.com

What It Checks:

  • Network connectivity
  • Packet loss
  • Response time (latency)

Common Scenarios:

SituationMeaning
Reply receivedNetwork working
Request timed outDestination unreachable
Destination host unreachableRouting problem

👉 Used to verify whether the issue is:

  • Local network problem
  • Gateway issue
  • Internet issue

🌍 3️⃣ nslookup

📖 Purpose

The nslookup command is used to query DNS (Domain Name System) servers to get information about domain names and IP addresses.

  • It helps you find the IP address of a domain name (forward lookup) – Example : nslookup google.com
  • Or find the domain name of an IP address (reverse lookup) – E.xample : nslookup 8.8.8.8
  • It can also show details of the DNS server being used.

 

Uses:-

  • To check if a domain name is resolving properly.
  • To troubleshoot DNS issues.
  • To find the IP address of a website

🔧 Practical Usage

nslookup google.com

What It Checks:

  • Domain name to IP resolution
  • Which DNS server responded
  • Whether DNS is working properly

👉 If ping fails but nslookup works → Internet OK, but routing issue.
👉 If nslookup fails → DNS problem.

📊 4️⃣ netstat

📖 Purpose

The netstat command is used to display active network connections and statistics. 

It shows :-

  • Active connections - who your computer is connected to.
  • Listening ports - open ports waiting for a connection.
  • Protocol usage (TCP, UDP, ICMP, etc.).
  • Network statistics (packets sent/received, errors).

Uses:

  • To check if a domain name is resolving properly.
  • To troubleshoot DNS issues.
  • To find the IP address of a website.

🔧 Practical Usage

netstat -an

What It Shows:

  • Active TCP/UDP connections
  • Listening ports
  • Foreign addresses

Useful for:

  • Checking if the application is using a port
  • Identifying malware connections
  • Troubleshooting server port issues

🛣 5️⃣ tracert

📖 Purpose

It shows the path that data packets take from your computer to a destination and also measures the time taken at each hop.

Uses:

  • Troubleshooting network connectivity issues
  • Finding where the network is slow or failing
  • Checking the path taken to reach a server
  • Detecting if there’s a bottleneck in your network

🔧 Practical Usage

tracert google.com

What It Shows:

  • Number of hops
  • Routers in the path
  • Delay at each hop

🔁 6️⃣ arp

📖 Purpose

  • Shows the ARP table
  • ARP table stores the mapping of IP addresses to the MAC address of devices in a LAN

NOTE : It do not include all the devices present in LAN, it only shows the mapping for the devices that your local computer recently communicated with or tried to.

🔧 Practical Usage

arp -a

à Shows the IP address and MAC address of the devices present in LAN

What It Shows:

  • IP address
  • Corresponding MAC address
  • Interface

 

Used For:

  • Detecting IP conflicts
  • Verifying device MAC address
  • Checking local network communication

 

🛤 7️⃣ route print

📖 Purpose

  • The route command is used to view and manipulate the routing table of your computer.
  • The routing table tells your system where to send network packets based on the destination IP address.

 

🔧 Practical Usage

route print

  • It shows the routing table
  • It shows a list of all the routes (paths) your computer uses to send data packets across networks.

What It Shows:

  • Network destination
  • Netmask
  • Gateway
  • Interface
  • Metric

 

Used For:

  • Checking default gateway (0.0.0.0)
  • Diagnosing routing problems
  • Verifying static routes

 

🧠 How to Troubleshoot Step-by-Step (Very Important)

If the internet is not working:

1️⃣ ipconfig → Check IP address
2️⃣ ping 127.0.0.1 → Check local TCP/IP
3️⃣ ping default gateway → Check router connectivity
4️⃣ ping 8.8.8.8 → Check internet
5️⃣ nslookup google.com → Check DNS
6️⃣ tracert google.com → Check routing path

 

🎓 Interview Question

❓ How do you troubleshoot when the internet is not working?

First, I check IP configuration using ipconfig, then verify connectivity using ping, check DNS using nslookup, and analyze routing using tracert and route print.