babajipatil-square

Babaji Patil

Linux administrator

πŸš€ Linux Networking: DNS, Ports, Routes & Connectivity β€” A Practical Troubleshooting Guide

Networking issues are a common challenge in Linux administration. Whether you're troubleshooting application connectivity, investigating DNS resolution failures, or checking firewall rules, knowing the right commands can save valuable time. Here are some essential Linux networking commands every System Administrator and DevOps Engineer should know. πŸ‘‡ πŸ”Ή **1. Check Network Interfaces and IP Addresses** ```bash ip addr show ip link show ``` πŸ“Œ Use these commands to verify IP addresses, interface status, and network interface details. πŸ”Ή **2. Troubleshoot DNS Resolution** ```bash cat /etc/resolv.conf nslookup example.com dig example.com getent hosts example.com ``` πŸ“Œ Check DNS server configuration and hostname resolution. `getent hosts` is especially useful for checking resolution through the system's configured name service mechanisms. πŸ”Ή **3. Check Listening Ports and Services** ```bash ss -tulnp ss -lntp ``` πŸ“Œ Identify listening TCP/UDP sockets and, where permissions allow, the processes using them. πŸ”Ή **4. Test Network Connectivity** ```bash ping -c 4 8.8.8.8 curl -Iv https://example.com nc -vz server.example.com 443 ``` πŸ“Œ These commands help test IP reachability, HTTPS connectivity, and TCP port availability. Remember: A failed ping doesn't always mean a server is unreachable, because ICMP traffic may be blocked. πŸ”Ή **5. Inspect Routing and the Default Gateway** ```bash ip route show ip route get 8.8.8.8 ``` πŸ“Œ Verify the routing table, default gateway, and interface that Linux would use to reach a destination. πŸ”Ή **6. Check Firewall Rules** ```bash sudo firewall-cmd --list-all sudo nft list ruleset ``` πŸ“Œ Review firewall configuration when traffic is unexpectedly blocked. Use the command appropriate to your system's firewall setup. πŸ”Ή **7. Trace the Network Path** ```bash tracepath example.com traceroute example.com ``` πŸ“Œ Investigate the network path and identify where responses stop, while remembering that intermediate routers may not

Report this card

Tell us what’s wrong with this card from @btpatil. Your report is not shown on their profile.

Intimate image shared without consent? Get removal instructions.

TCS
Get your frfr. link