Network services: DHCP, static vs dynamic IP, DNS, NAT and routing
In short: Network services help devices and applications communicate. DHCP hands out IP settings automatically on a lease, DNS turns names into addresses, NAT lets private addresses reach the internet, and routing (static or dynamic) chooses the path between networks.
DHCP: automatic IP settings
The Dynamic Host Configuration Protocol assigns IP settings from a central server, saving administrators from configuring every device by hand and preventing duplicate addresses. It also saves address space, because only devices that are actually connected hold an address.
- Scopes: each network segment has its own pool (scope) of addresses on the server.
- More than an address: DHCP also gives the subnet mask, default gateway and DNS servers.
- Leases: addresses are lent for a set time. The client renews before the lease ends; if it disappears, the address returns to the pool. Because clients only learn about changes when they renew, plan lease times before changing DHCP settings.
- DHCP relay: DHCP Discover is a broadcast and routers don't forward broadcasts, so a router can act as a relay agent and forward the request to a central server, adding information (option 82) about which network and port it came from so the right scope is used.
Security: a rogue DHCP server can hand out a fake gateway and capture traffic. Managed switches block this with DHCP snooping.
Static vs dynamic IP addresses
| Static | Dynamic (DHCP) | |
|---|---|---|
| How it's set | Configured manually; stays the same | Assigned automatically; may change |
| Best for | Servers, printers, routers, cameras: anything others must always find | PCs, laptops, phones, guests |
| Advantages | Always the same, easy to reference | No manual work, no conflicts, efficient use of addresses |
| Drawbacks | Manual effort, risk of typing errors and duplicates | Address may change unless a reservation is made |
A good middle ground is a DHCP reservation: the server always gives the same address to a device's MAC address.
DNS: names to addresses
When a user types a fully qualified domain name (FQDN) such as www.example.com, the computer asks a DNS server for the matching IP address, receives it, and then connects to that address. Without DNS, people would have to remember numbers for every site. Full details in How DNS works.
NAT: private to public
Private IPv4 addresses can't be used on the internet, so they must be translated to a public address on the way out. Network Address Translation (NAT) does this on the router or firewall. The most common form, PAT (or NAT overload), lets hundreds of devices share one public IP by tracking port numbers.
Learn more in NAT explained.
Routing: static and dynamic
Routing is choosing the path packets take between networks. Routers learn paths in two ways:
| Static routing | Dynamic routing | |
|---|---|---|
| How | Routes typed in by an administrator | Routers share information and calculate routes automatically |
| Advantages | Simple, predictable, no protocol overhead | Adapts to failures and changes, little manual work |
| Disadvantages | Doesn't adapt; hard work in large networks | More complex, uses CPU, memory and bandwidth |
| Examples | ip route 0.0.0.0 0.0.0.0 203.0.113.1 | RIP, OSPF, EIGRP, BGP |
Small sites often use a single static default route to the ISP; larger networks use OSPF inside and BGP between organisations. RIP is a simple distance-vector protocol that is good for learning in labs, but it is slow to react and limited to 15 hops, so it is rarely used in production today.
! RIP version 2 lab example (Cisco IOS)
router rip
version 2
no auto-summary
network 192.168.10.0
network 10.0.0.0
Real-world example: a shop where nothing could get online
A clothing shop with two tills, a back-office PC and staff Wi-Fi called its IT support company: no device could reach the internet. The technician arrived and found the tills showing addresses starting 169.254, which means they had not received an address from DHCP. The shop's router, which acted as DHCP server, DNS forwarder and NAT gateway, had been reset to factory settings after a power cut, and its DHCP pool was disabled.
The technician re-enabled DHCP with a range for staff devices, added reservations so the two tills and the receipt printer always got the same addresses, set reliable public DNS servers, and confirmed NAT translated the shop's private addresses to the single public IP. Finally, she saved a copy of the configuration so that the next reset could be reversed in minutes rather than hours.
Practice
Put the DHCP messages in order.
Should a network printer use a static or dynamic address? Why?
Why can’t a PC with address 192.168.1.10 browse the internet without NAT?
Key takeaways
- DHCP leases IP settings automatically using Discover, Offer, Request, Acknowledge.
- Use static addresses or reservations for servers and printers, dynamic for user devices.
- DNS resolves names to IP addresses; NAT/PAT lets private addresses share a public one.
- Static routes are simple but manual; dynamic protocols (OSPF, BGP) adapt automatically.
- Protect DHCP with DHCP snooping on managed switches.
Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.