Understanding Linux Networking and DNS Resolution: A Complete Guide
Introduction
Networking is a fundamental aspect of Linux system administration and cloud computing. As a DevOps and Cloud Engineer, mastering Linux networking and DNS (Domain Name System) resolution is essential for managing servers, troubleshooting connectivity issues, and optimizing system performance.
In this guide, we’ll cover:
✅ Basic Linux networking commands
✅ How DNS resolution works in Linux
✅ Common networking issues and troubleshooting techniques
1. Basics of Linux Networking
Linux networking is built on TCP/IP, which includes IP addresses, subnet masks, gateways, and DNS servers. Below are the key Linux commands used to manage and troubleshoot networks.
Checking Network Configuration (ip and ifconfig)
To view all network interfaces and IP addresses:
ip a→ Displays all network interfaces, IP addresses, and MAC addresses.ifconfig→ Shows network details (older command, now replaced byip).
To check only active network interfaces:
ip link show up
To find your system's default gateway (router):
ip route
Checking Internet Connectivity (ping)
To test if your server can reach an external website:
- If successful, it shows response times in milliseconds.
- If it fails, check your network settings or DNS configuration.
To check which ports are currently open:
-t→ TCP connections-u→ UDP connections-l→ Listening ports-n→ Numeric IPs-p→ Show process names
Newer alternative using ss:
ss is faster and preferred in modern Linux systems.
Testing Network Routes (traceroute)
To see how your request reaches a destination:
- This shows all network hops between your system and Google's servers.
- If a connection fails, it helps pinpoint where the issue is.
If traceroute is not installed, install it with:
Comments
Post a Comment