🌐 Day 5 of #150DaysOfDevOps – Networking Story: From DNS to Troubleshooting

Vignesh MVignesh M
3 min read

“Imagine you're Alice, building a web app. You’ve set up multiple servers — a web frontend, a database, and an NFS file server — all on different networks. Now what?”

🖥️ Alice’s Setup

  • Web Server → 192.168.1.10

  • NFS Server → 192.168.2.20

  • DB Server → 192.168.3.30

Alice wants all of them to talk to each other — by hostname, not IP. But they're in different subnets. Let’s walk through how she solves this.

🖼️ See the diagram above for a visual overview of Alice’s environment.

🧭 Step 1: Set Up DNS for Easy Access

Alice doesn’t want to remember IPs. So she edits:

sudo nano /etc/hosts

Adds:

192.168.2.20 nfs.local
192.168.3.30 db.local

Now:

ping nfs.local
ping db.local

Works like magic! 🎉

She checks DNS resolution details:

cat /etc/resolv.conf
cat /etc/nsswitch.conf

🔁 Step 2: Configure Switching

Each server interface must be up and reachable.

ip link set eth0 up
ip addr add 192.168.1.10/24 dev eth0

Switches connect devices within the same subnet.

  • NFS and Web Server on same subnet? No routing needed.

  • NFS and DB on different networks? Routing required.

Alice uses:

ip a
ip link

To verify connectivity.


🛣️ Step 3: Routing Across Networks

Alice tries:

ping db.local

❌ No reply. Why?

The networks differ. She checks her routing table:

ip route

Adds manual routing:

ip route add 192.168.3.0/24 via 192.168.2.1

And from DB back to NFS:

ip route add 192.168.2.0/24 via 192.168.3.1

Now all systems can talk!


🛠️ Step 4: Hands-on Troubleshooting

Bob (her teammate) can’t access the NFS from the DB server. Alice helps:

✅ Interface Check

ip link show

enp1s0f1 is down:

ip link set dev enp1s0f1 up

✅ Ping and DNS Lookup

ping nfs.local
nslookup nfs.local
dig nfs.local

✅ Route Check

ip route

Missing gateway? Add:

ip route add 192.168.2.0/24 via 192.168.3.1

✅ Port Availability

ss -tuln | grep 2049
netstat -an | grep 2049

NFS service not listening? Restart it:

sudo systemctl restart nfs-server

🧠 Advanced Network Commands Alice Uses

CommandPurpose
traceroute <IP>View hop-by-hop route to destination
getent hosts nfs.localDNS + /etc/hosts resolution
tcpdump -i any port 53Watch DNS traffic in real time
nmap 192.168.3.30Port scanning
hostname -ISee all IPs on host

💡 Takeaways from Alice’s Networking Story

✅ Set up hostnames with /etc/hosts or DNS
✅ Use switches for same-network communication
✅ Configure static routes between subnets
✅ Debug with ping, dig, ss, ip route, and traceroute
✅ Always check interfaces and service status first

0
Subscribe to my newsletter

Read articles from Vignesh M directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Vignesh M
Vignesh M

🛠️ DevOps Engineer in Progress | 🚀 Documenting my #150DaysOfDevOps journey | 💡 Passionate about Linux, Cloud & Automation | 🌐 Sharing what I learn every day