Network Fundamentals — IP, DNS, and Ports
Understand IP addresses (IPv4/IPv6), how DNS resolves domain names, and what ports are used for on a Linux system.
What Is a Network?
Every device on a network has an IP address that uniquely identifies it. Linux systems need to understand IP addressing, DNS, and ports to communicate over a network.
IPv4 Addresses
IPv4 uses four 8-bit octets (0–255) separated by dots, giving ~4.3 billion unique addresses.
# Private ranges (local networks only)
10.x.x.x
172.16.x.x – 172.31.x.x
192.168.x.x
# Loopback (yourself)
127.0.0.1
# Check your own IP
hostname -I
ip addrIPv6
IPv6 uses 128-bit addresses written in hexadecimal — virtually unlimited address space.
# Example IPv6 address
2001:0db8:85a3:0000:0000:8a2e:0370:7334
# Show IPv6 addresses
ip -6 addrDNS — Domain Name System
DNS translates human-readable domain names to IP addresses: google.com → 142.250.80.46.
# View configured DNS servers
cat /etc/resolv.conf
# Manual DNS lookups
nslookup google.com
dig google.com
host google.comCommon Ports
Ports (0–65535) identify specific services. Well-known ports:
| Port | Service |
|---|---|
| 22 | SSH |
| 80 | HTTP |
| 443 | HTTPS |
| 3306 | MySQL |
| 5432 | PostgreSQL |
| 3000 | Node.js |
Network Interfaces
ip addr # Show all interfaces
ip addr show eth0 # Specific interface
ifconfig # Legacy command
hostname -I # Quick IP listPrivate IPs (10.x, 172.16-31.x, 192.168.x) are never routed over the internet — they're for local networks only.
What does DNS stand for?
Run hostname -I to see your IP address. Then run dig google.com +short to see its IP.