- Practice
- About 14 min
- 5 practice questions
IP addresses, DNS and packets: practice problems
Check IPv4 addresses for validity, count addresses, find your own IP address on Windows, and order the steps of a DNS lookup and packet delivery.
If something looks wrong, please tell us.
Addressing questions reward a few fixed rules applied carefully. This lesson turns the ideas of packets, IP addresses and DNS into problems you can solve in seconds, and shows two real tasks you can try on a Windows computer.
Rules for a valid IPv4 address
- Exactly four parts, separated by three dots.
- Each part is a whole number from 0 to 255 (each part is 8 bits, called an octet, and 8 bits give 256 values).
- Only digits and dots; no letters, spaces or other signs.
The whole address is 4 × 8 = 32 bits, so the total number of IPv4 addresses is 2 to the power 32 = 4,294,967,296, about 4.3 billion. IPv6 addresses are 128 bits and use hexadecimal digits (0-9 and a-f) in groups separated by colons, so letters a-f are allowed there.
| Address or range | Special meaning |
|---|---|
| 127.0.0.1 | Loopback (localhost): the computer talking to itself |
| 10.x.x.x | Private range, used inside home and office networks |
| 172.16.x.x to 172.31.x.x | Private range |
| 192.168.x.x | Private range, very common on home routers |
Private addresses are used inside a local network and are not reachable directly from the internet; the router shares one public address among them. Most ISPs give home connections a dynamic IP address that can change, assigned automatically by a service called DHCP (Dynamic Host Configuration Protocol); a static address stays fixed and suits servers.
Step-by-step: find your IP address on Windows
- Press the Windows key, type cmd and press Enter to open Command Prompt.
- Type ipconfig and press Enter.
- Find the section for your network adapter (Wi-Fi or Ethernet).
- Read the line IPv4 Address; it is often of the form 192.168.x.x at home.
- To test whether a site can be reached, type ping followed by its domain name and press Enter; replies mean it answered.
DNS and packets in order
For any arrange in order question, anchor two ends first: you always start by typing the name, and you always end by seeing the page. Between them, the name must be turned into a number (DNS) before any request can be sent to the server, and packets must arrive before they can be reassembled. If DNS fails, websites will not open by name, but would still open if you typed the server's IP address directly.
Worked example 1: which addresses are valid?
| Address | Check | Valid? |
|---|---|---|
| 192.168.0.1 | Four parts, all 0-255 | Yes |
| 10.256.1.1 | 256 is more than 255 | No |
| 172.16.4 | Only three parts | No |
| 8.8.8.8 | Four parts, all 0-255 | Yes |
| 192.168.1.a | Contains a letter | No |
Worked example 2: packets and resending
A 4.8 MB file (take 4,800 KB) is sent in packets of 1.2 KB of data each. During the transfer, 2% of packets are lost and resent once. How many packets are sent in all? Working: packets needed = 4,800 ÷ 1.2 = 4,000. Lost = 2% of 4,000 = 80. Total sent = 4,000 + 80 = 4,080. Only lost packets are resent, because TCP tracks each one by its sequence number.
Worked example 3: counting with octets
How many different values can the last part of an IPv4 address take? Working: one part is 8 bits; 2 to the power 8 = 256 values, numbered 0 to 255. Trap: the answer is 256, not 255, because 0 also counts.
IPv4: four parts, each 0-255, 32 bits in all. IPv6: 128 bits in hexadecimal. 127.0.0.1 is the computer itself. ipconfig shows your address on Windows.
Key takeaways: test an IPv4 address part by part - count four parts, check each is 0 to 255, and reject letters. Know the loopback and private ranges. For order questions, DNS comes before the request, and reassembly comes after delivery.
Check your understanding
-
1. Which command, typed in the Windows Command Prompt, shows your computer's IP address?
- ipconfig
- dir
- cls
- format
Show answer
Answer: A. ipconfig lists the network settings of each adapter, including the IPv4 address. dir lists files, cls clears the screen and format erases a disk.
-
2. The address 127.0.0.1 refers to:
- The ISP's DNS server
- The computer itself (loopback)
- A government website
- The nearest router
Show answer
Answer: B. 127.0.0.1 is the loopback address, also called localhost: traffic sent to it never leaves the computer.
-
3. Which of these is a valid IPv4 address?
- 256.10.10.10
- 10.0.0.256
- 192.168.1
- 203.0.113.45
Show answer
Answer: D. 203.0.113.45 has four parts, each from 0 to 255. The others have a part of 256 or only three parts.
-
4. A file of 3,600 KB is sent in packets of 1.2 KB. If 5% of packets are lost and resent once, how many packets are sent in total?
- 3,000
- 3,600
- 3,150
- 3,050
Show answer
Answer: C. Packets needed = 3,600 ÷ 1.2 = 3,000. Lost = 5% of 3,000 = 150. Total = 3,000 + 150 = 3,150.
-
5. DNS has stopped working on a computer, but the internet line is fine. What will the user notice?
- Websites do not open by name, though one would open if its IP address were typed
- The computer cannot start
- Wi-Fi bars disappear
- Files cannot be copied to a USB drive
Show answer
Answer: A. DNS only turns names into IP addresses. Without it, names fail, but the network still carries traffic to a typed IP address.
Sign in to keep track of the lessons you finish.