• 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

  1. Exactly four parts, separated by three dots.
  2. Each part is a whole number from 0 to 255 (each part is 8 bits, called an octet, and 8 bits give 256 values).
  3. 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.

Addresses worth recognising
Address or rangeSpecial meaning
127.0.0.1Loopback (localhost): the computer talking to itself
10.x.x.xPrivate range, used inside home and office networks
172.16.x.x to 172.31.x.xPrivate range
192.168.x.xPrivate 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

  1. Press the Windows key, type cmd and press Enter to open Command Prompt.
  2. Type ipconfig and press Enter.
  3. Find the section for your network adapter (Wi-Fi or Ethernet).
  4. Read the line IPv4 Address; it is often of the form 192.168.x.x at home.
  5. 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?

AddressCheckValid?
192.168.0.1Four parts, all 0-255Yes
10.256.1.1256 is more than 255No
172.16.4Only three partsNo
8.8.8.8Four parts, all 0-255Yes
192.168.1.aContains a letterNo

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. 1. Which command, typed in the Windows Command Prompt, shows your computer's IP address?

    1. ipconfig
    2. dir
    3. cls
    4. 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. 2. The address 127.0.0.1 refers to:

    1. The ISP's DNS server
    2. The computer itself (loopback)
    3. A government website
    4. 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. 3. Which of these is a valid IPv4 address?

    1. 256.10.10.10
    2. 10.0.0.256
    3. 192.168.1
    4. 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. 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?

    1. 3,000
    2. 3,600
    3. 3,150
    4. 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. 5. DNS has stopped working on a computer, but the internet line is fine. What will the user notice?

    1. Websites do not open by name, though one would open if its IP address were typed
    2. The computer cannot start
    3. Wi-Fi bars disappear
    4. 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.

Privacy · Terms · Refunds · Delivery