Networking Basics
Understand IP addresses, ports, DNS, and HTTP — the fundamentals of network communication.
What you'll learn
- IP addresses, ports, and the TCP/IP model
- How DNS resolves domain names to IP addresses
- HTTP requests, responses, and status codes
- Common networking commands: ping, curl, netstat
Concept
IP Addresses and Ports
Every device on a network has an IP address — a unique identifier that lets other devices find it. IPv4 addresses look like 192.168.1.1; IPv6 addresses are longer, like 2001:db8::1. Ports are numbered channels on an IP address (0–65535). A web server typically listens on port 80 (HTTP) or 443 (HTTPS). The combination of IP and port — 192.168.1.1:3000 — identifies a specific service on a specific machine.
DNS
The Domain Name System (DNS) translates human-readable domain names like example.com into IP addresses that computers use to connect. When you type a URL, your computer queries a DNS resolver, which returns the IP address. DNS also stores other records: MX records for email, CNAME records for aliases, and TXT records for verification. The dig and nslookup commands let you query DNS records directly.
HTTP
HTTP is the protocol that web browsers and servers use to communicate. A client sends a request with a method (GET, POST, PUT, DELETE) and a URL. The server returns a response with a status code and a body. Status codes in the 200s mean success, 300s mean redirection, 400s mean client errors, and 500s mean server errors. HTTPS adds TLS encryption on top of HTTP to protect data in transit.
Diagnostic Commands
DevOps engineers use several commands to diagnose network issues. ping checks if a host is reachable. curl makes HTTP requests from the terminal. netstat and ss show which ports are in use. traceroute shows the path packets take to a destination. These tools are indispensable for debugging connectivity issues and verifying that services are accessible.
Security Considerations
Network security is a core DevOps responsibility. Use firewalls to restrict which ports are accessible. Use TLS to encrypt traffic in transit. Use VPN or SSH tunnels to access internal services securely. Understand the difference between public and private IP ranges — 10.x.x.x, 172.16.x.x, and 192.168.x.x are private and not routable on the internet. Misunderstanding network boundaries is a common cause of security incidents, so always verify which interfaces and ports your services are exposed on.
Example
# Check connectivity
ping -c 4 google.com # send 4 ping packets
curl -I https://example.com # fetch HTTP headers only
# DNS lookups
dig example.com # query A record
dig MX example.com # query mail records
nslookup api.example.com
# Inspect open ports and connections
ss -tlnp # list listening TCP ports
netstat -tlnp # older alternative
# Make an API request
curl -X POST https://api.example.com/users \
-H "Content-Type: application/json" \
-d '{"name":"Alice"}'
ping checks reachability, dig queries DNS, ss/netstat show open ports, and curl makes HTTP requests. These are the core network diagnostic tools.
Try it
- DNS Lookup
Query DNS records for any domain.
- HTTP Status Codes
Reference for HTTP response status codes.
- My IP Address
Check your public and local IP address.
Common mistakes
The mistake
Confusing TCP and UDP
The fix
TCP is connection-oriented and reliable (web, email). UDP is connectionless and fast but may drop packets (DNS, video streaming). Choose based on whether you need guaranteed delivery.
The mistake
Forgetting to check DNS propagation after changes
The fix
DNS changes can take minutes to hours to propagate. Use dig against different resolvers (dig @8.8.8.8 example.com) to check propagation status.
Practice Networking Basics
1 exercise
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.