Free tech learning for everyone, from basics to pro

Network FundamentalsNetworking SecurityIntermediate

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.

The DHCP DORA processClientneeds an addressDHCP serverhas a scope1. Discover: broadcast: is there a DHCP server?2. Offer: you can have 192.168.1.503. Request: yes, I would like 192.168.1.504. Acknowledge: confirmed: lease 8 hours, + mask, gateway, DNS
Figure 1. A device joining the network gets its IP settings in four messages: Discover, Offer, Request, Acknowledge.
  • 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

StaticDynamic (DHCP)
How it's setConfigured manually; stays the sameAssigned automatically; may change
Best forServers, printers, routers, cameras: anything others must always findPCs, laptops, phones, guests
AdvantagesAlways the same, easy to referenceNo manual work, no conflicts, efficient use of addresses
DrawbacksManual effort, risk of typing errors and duplicatesAddress 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.

NAT translates private addresses to one public address192.168.1.10192.168.1.11192.168.1.12NAT routerkeeps a translation tablepublic 203.0.113.5Internet
Figure 2. Many private addresses share one public address; the router remembers which reply belongs to which device.

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 routingDynamic routing
HowRoutes typed in by an administratorRouters share information and calculate routes automatically
AdvantagesSimple, predictable, no protocol overheadAdapts to failures and changes, little manual work
DisadvantagesDoesn't adapt; hard work in large networksMore complex, uses CPU, memory and bandwidth
Examplesip route 0.0.0.0 0.0.0.0 203.0.113.1RIP, 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.
Discover, Offer, Request, Acknowledge (DORA).
Should a network printer use a static or dynamic address? Why?
Static, or a DHCP reservation: users and print servers need to find it at the same address every time.
Why can’t a PC with address 192.168.1.10 browse the internet without NAT?
192.168.x.x is a private range that is not routed on the internet, so it must be translated to a public address.

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.
Tracks your learning on this device only. See your progress on the learning paths.

About the author

Mohamed Fayas

Founder of FM TecHub. CCNA certified, with a BTEC HND in Network Engineering, and BEng (Hons) in Computer Networking and Cloud Security. He writes practical, plain-English guides on networking, security and cloud.

More about the author

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.

Stay up to date by email

New notes, tools and security news from FM TecHub, explained simply. Free.

We only use your email to send these updates. See our privacy policy.