π PART 1 β HOW DEVOPS THINKS
When something βdoesnβt work,β DevOps engineers follow a logical flow:
- Do I have network connectivity?
- Does DNS resolve correctly?
- Is the server reachable?
- Is the port open?
- Is the application running?
We always troubleshoot layer by layer, not randomly.
π§ͺ PART 2 β CORE NETWORK COMMANDS
1. Check Your IP Address
ip a
π How to read:
-
inet 192.168.x.xβ your machineβs IP -
127.0.0.1β localhost -
eth0,ens33β network interfaces
β When to use:
- No internet
- Checking if machine has an IP
2. Check Connectivity (Ping)
ping google.com
π How to read:
-
64 bytes from ...β connection is working -
time=20msβ latency -
Request timeoutβ no connection
β When to use:
- Server not responding
- Check internet access
3. Trace Network Path
traceroute google.com
π How to read:
- Each line = one hop
-
* * *β failure at that point
β When to use:
- Ping works but app doesnβt
- Identify where connection breaks
4. DNS Check
nslookup google.com
π How to read:
-
Address:β resolved IP - Error β DNS issue
β When to use:
- Domain not working
- Suspected DNS problem
5. Advanced DNS Tool
dig google.com
π How to read:
-
ANSWER SECTIONβ IP -
status: NOERRORβ success
β When to use:
- Deep DNS troubleshooting
6. Test HTTP/HTTPS
curl http://example.com
π Better version:
curl -I http://example.com
π How to read:
-
200 OKβ success -
404β not found -
500β server error -
Connection refusedβ service down
β When to use:
- API testing
- Website issues
7. Check Open Ports
netstat -tulnp
π How to read:
-
LISTENβ port is open -
:80,:443β ports - Process name β service
8. Modern Alternative
ss -tulnp
β When to use:
- Same as netstat (preferred today)
9. Check Which Process Uses a Port
lsof -i :3000
π Output shows:
- Process name
- PID
- Port
10. Test Port Connectivity
Option 1 β Telnet
telnet google.com 80
Option 2 β Netcat (recommended)
nc -zv google.com 80
π How to read:
-
succeededβ port open -
failedβ port closed
11. Check Routing
ip route
π How to read:
-
default viaβ gateway (internet path)
12. Simple DNS Tool
host google.com
13. Download Test
wget http://example.com
π§ͺ PART 3 β HANDS-ON LAB
π₯ Task 1 β Check Network Connectivity
ping 8.8.8.8
π If this fails β network issue
π₯ Task 2 β Check DNS
nslookup google.com
π If this fails β DNS problem
π₯ Task 3 β Check Website Response
curl -I https://google.com
π Find the status code
π₯ Task 4 β Check Port Availability
nc -zv google.com 443
π₯ Task 5 β Check Local Service
Run your app:
node app.js
Then check:
ss -tulnp | grep 3000
π₯ Task 6 β Find Process Using Port
lsof -i :3000
π§ͺ PART 4 β REAL DEVOPS SCENARIO
β Problem:
βApplication is not accessibleβ
β Step-by-step troubleshooting:
1. Check internet
ping 8.8.8.8
2. Check DNS
nslookup myapp.com
3. Check server
ping myapp.com
4. Check port
nc -zv myapp.com 443
5. Check HTTP
curl -I https://myapp.com
π§ PART 5 β IMPORTANT INTERVIEW KNOWLEDGE
You MUST understand:
-
pingβ connectivity -
nslookup/digβ DNS -
curlβ HTTP -
ss/netstatβ ports -
ncβ port testing -
tracerouteβ path
Top comments (0)