IP Addresses, Gateways, DHCP and DNS
Learn the four settings every networked device needs, how DHCP hands them out, what a 169.254 address means, and how DNS turns names into addresses.
Welcome back!
Step 1 of 12Learn
Four settings every device needs
To talk on a network, a computer needs four pieces of information. Almost every "I can't get online" ticket comes down to one of them being wrong or missing.
- IP address: the device's address on the network, such as 192.168.1.42. Each device on a network needs a unique one.
- Subnet mask: tells the device which addresses are local (on the same network) and which are far away. A very common mask is 255.255.255.0, meaning the first three numbers identify the network.
- Default gateway: the router that forwards traffic to other networks, including the internet. Usually an address like 192.168.1.1.
- DNS server: the service that translates names such as example.com into IP addresses.
In homes and offices, private address ranges are used internally: 10.x.x.x, 172.16.x.x to 172.31.x.x and 192.168.x.x. The router translates them to a public address on the internet.
Think of it like mail: the IP address is your house number, the subnet mask defines your street, the gateway is the post office that handles anything going off your street, and DNS is the directory that turns a person's name into their address.
Step 2 of 12Practice · Match the pairs
Match each network setting to its role.
Tap an answer, then tap the place where it belongs (or drag it there).
- IP address
- Subnet mask
- Default gateway
- DNS server
Step 3 of 12Diagram
Opening a website, step by step
Tap a shape with to see more.
- Your laptop
Has an IP address and subnet mask, so it knows its local network.
- DNS server
Turns example.com into an IP address.
- Default gateway
The router that forwards traffic off the local network.
- Internet
Routers pass the packets along.
- Web server
Replies to your IP address.
Step 4 of 12Learn
DHCP and the 169.254 warning sign
Nobody types these four settings into every laptop by hand. DHCP (Dynamic Host Configuration Protocol) does it automatically. When a device joins a network, it broadcasts a request; a DHCP server, usually the router or a server in the office, replies with an IP address, subnet mask, gateway and DNS servers. The address is a lease that lasts for a set time and is renewed automatically.
Servers, printers and network equipment often get static (fixed) addresses or DHCP reservations instead, so their addresses never change and people can always find them.
Here's a clue worth memorizing: if a Windows or Mac device asks for an address and no DHCP server answers, it assigns itself an address starting with 169.254. This is called APIPA, or a link-local address. A 169.254 address means: "I'm physically connected to something, but I never got an address from DHCP." Common causes are a bad cable or Wi-Fi association, a disabled network port, the DHCP server being down or out of addresses, or the device being on the wrong network segment (VLAN).
Another special address: 127.0.0.1 is the loopback address, the computer talking to itself. Pinging it tests the computer's own network software, not the network.
Step 5 of 12Practice · Choose one
A user can't reach anything on the network. Running ipconfig shows the IP address 169.254.37.120. What does this most likely mean?
Step 6 of 12Practice · Diagram
How DHCP hands out an address (DORA)
If the network cable is unplugged, which step is the first that cannot get an answer?
Tap the shape that answers the question, then press Check.
- Discover
The device broadcasts: "Is there a DHCP server?"
- Offer
The server offers an address, mask, gateway and DNS.
- Request
The device asks to use that offer.
- Acknowledge
The server confirms; the lease starts.
Step 7 of 12Learn
DNS: when the network works but names don't
People remember names; networks route by numbers. DNS (Domain Name System) is the internet's phone book. When you type a website name, your computer asks its DNS server for the matching IP address, then connects to that address. Results are cached for a while so repeat visits are faster.
DNS problems create a recognizable pattern: the network is clearly up (you can ping an IP address, chat apps that are already connected keep working), but websites fail with messages like "server not found" or "DNS_PROBE_FINISHED_NXDOMAIN." Inside a company, DNS also finds internal servers, so a DNS failure can make file shares and internal apps vanish while the internet looks fine, or the other way around.
Typical fixes and tests at tier 1:
- ipconfig /flushdns clears a stale local cache, for example after a server moved to a new address.
- nslookup example.com asks DNS directly and shows which server answered and what address it returned.
- Check which DNS servers the device received from DHCP. A home router's address showing up on a work laptop that should use the company DNS is a clue (for example, a VPN that didn't connect).
The saying "it's always DNS" is a joke among network engineers, but DNS really is behind a surprising number of mysterious outages.
Step 8 of 12Flashcards
Network vocabulary
Tap a card to flip it.
Step 9 of 12Practice · Sort into groups
Sort each address into the right group.
Tap an item, then tap its group (or drag it there).
Step 10 of 12Note
Step 11 of 12Practice · Choose one
A laptop shows IP address 10.4.12.88, mask 255.255.255.0 and a blank default gateway. What will most likely happen?
Step 12 of 12Practice · True or false
If a user can open a website by typing its IP address but not by typing its name, the most likely problem is DNS.
Lesson complete!